I have an Ultragrid which display things with backcolor depending on situation...
When I try to print, in the print preview, I got this (which is the same I got if I do print)...
So, question is simple : What should I do in order to get the same result as what I see when "consulting" the grid as normal...
Hi Nicloas,
It looks like you intended to post an image with your post, but I don't see the image. To attach an image file, go to the Options tab while posting and just attach the image as a file.
Ok
In the screenshot "composition", First picture is the grid being used in my application... with a Style and the
color treatment...
private void EtatGrid_InitializeRow(object sender, Infragistics.Win.UltraWinGrid.InitializeRowEventArgs e) { if(e.Row.Cells["Process"].Value.ToString() != "OK") { e.Row.Appearance.AlphaLevel = 200; e.Row.Appearance.BackColorAlpha = Infragistics.Win.Alpha.Opaque; e.Row.Appearance.BackColor = Color.Red; } }
Second image is what I get when exporting for printing... As you can see, the red lines persists but not the backcolor...
Any logical explanations ?
thanks
Ok Mike
Here is my project... with only one screen...
To display the database, use menu "Display" => there is only one item inside
To print or export just use the item "print", "export" from the file menu.
In the config file, you have the connectionstring for the database
Anyway, in the archive menu, you have the ability to load an external database.
You can find one in the root folder of the archive.
To show data, pick a starting date (datetimepicker) at least 7/01/2014... (I haven't done test and record in the database today).
Normally, you have data with process column having "OK" value and some with "ERREUR" value which means "red" backcolor.
I hope this sample will help you in finding a solution to my problem...
I'm using SQLite database
Hi Nicolas,
I am unable to run your sample because it's referencing an assembly I don't have: System.Data.SQLite
Can you remove this from the project and re-post it here? There's no reason why the same should need to access SQL. Since the data is irrelevant to the problem, maybe you could just replace the grid's DataSource with a DataTable or UltraDataSource created in memory.
well the system.data.sqlite.dll is include in the bin\debug file so I guess you could easily readd it as a reference and check what is wrong.
You may have everything to challenge this situation !
Yes, the file is there, but it will not load. I am getting this error message:
Error 1 Metadata file 'C:\Users\MikeS\Desktop\INFRAGISTICS ERROR\Superviseur\bin\Debug\System.Data.SQLite.dll' could not be found C:\Users\MikeS\Desktop\INFRAGISTICS%20ERROR\Superviseur\CSC Superviseur
I suspect that maybe this file has some dependencies that are not installed on my machine or something.
I garbaged sqlite and make use of a simple List<MyItem>...
Now, you may be able to launch the program and see the behavior :)
You did follow me :)
FitWidthToPages made the trick...
So glad I did find answers to my questions.
Thanks a lot Mike...
Thanks from Toulouse, France.. ;)
Hi,
I'm not sure I follow you. The size of the PrintPreview dialog has no effect on the actual printout.
If you want the grid to print on a single page (width), you can do this:
private void ultraGrid1_InitializePrint(object sender, CancelablePrintEventArgs e) { e.DefaultLogicalPageLayoutInfo.FitWidthToPages = 1; } private void ultraGrid1_InitializePrintPreview(object sender, CancelablePrintPreviewEventArgs e) { e.DefaultLogicalPageLayoutInfo.FitWidthToPages = 1; }
You actually only have to do this in one of these two events, but which one you use depends on how you are printing, so I listed them both. Doing it both probably won't hurt, anyway.
It seems to be ok but for the nautilus style.
Ok thanks for your answer...
Just one last question: What property should I "play" with in order to have the printing of the grid fit a page..
My question is simple : If I change the size of the windows, the printPreview change what's on the page to be printed (the more width I have the more
pages are required to print the grid..)
Any clues ?
Thanks
I'm using the Nautilus style...
But would I have to do the same action for every ISL file a provide to my client ?
this isl file a right from your distribution of version 13.2.
So, do I have to "fix" on all ISL or is it only for the Nautilus style ?
Okay, the color is being overriden by a setting in the isl file. The isl is applying a background image to the Row with a solid white block image. I'm not sure why - it seems kind've odd, but the image is covering up the backcolor.When you alphablend, you are seeing the color through the image.
So the simplest solution would be to modify the isl and remove the image.
Open up the isl in AppStylist.
Go to the Grid canvas.
Mouse over any cell in the grid and press 2 - this will take you to the GridRow UIRole.
In the Background section, drop down the Image and select No image.
Then save the isl (you might want to save it as a copy so you don't overwrite the original) and use the new isl. Then you can set the color of a row without messing around with the alpha blending and the printing works fine.