We upgraded to 12.1.4 this morning. Blank reports that I create in our project now (or certain reports I pull up from the previous version) come up with a "Control does not support transparent background colors" message at the "ShowPreview" line at run-time. Whether I use this old methodology or the new method using the ReportPrintTool I get the same error.
XtraReport1 rpt = new XtraReport1();
ReportPrintTool tool = new ReportPrintTool(rpt);
tool.PreviewForm.Show();
XtraReport1 rpt2 = new XtraReport1();
rpt.ShowPreview();
rpt2.ShowPreview();
Help! I can view all the reports in the designer. But these reports don't have any controls on them. These reports all worked before. And I can't even add a new report to "recreate" the report. A blank report throws the errors.
I know this has something to do with my project. When I open a new C# project and add the report control I don't run into this. I just need some help trying to find a place I can start looking.
Oh, and I also tried to add the:
this.SetStyle(ControlStyles.SupportsTransparentBackColor, true);
line to my MDI form and the child form - no success.
Thanks,
Mark
Hi Mark,
Thank you for your report. This error occurs when the SupportsTransparentBackColor option is disabled and the Transparent background color is assigned to a control (Form). Our attempts to reproduce a similar error were unsuccessful. It looks like a different factor is involved. If possible, describe your application startup procedure in greater detail. We will check for a suitable solution.
This is my Program.cs file. From there it loads the main MDI form to the application, which has nothing in it but DevX and Windows .NET Controls. From there, I load a child form and then the report in the form_load event.
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.SetUnhandledExceptionMode(UnhandledExceptionMode.CatchException);
Application.ThreadException += new System.Threading.ThreadExceptionEventHandler(Application_ThreadException);
Application.Run(new forms.frmMDI());
Alright, so I think I've found the problem by narrowing down the loading event code. I have a login form that shows after the main form loads. In that login form, I have the following code:
layoutLogin.LookAndFeel.UseDefaultLookAndFeel = false;
layoutLogin.LookAndFeel.UseWindowsXPTheme = true;
layoutLogin.BackColor = Color.Transparent;
where layoutLogin is a custom layout control derived from DevExpress.XtraLayout.LayoutControl. When I set the backcolor to transparent on that last line, it affects all other forms in the project. And (I believe) when you run your show preview it's affected by that as well. I'm working on splitting this off right now by using the StyleController and applying it just to that control.
If you have any pointers for me on how to do this, I'd greatly appreciate it. In the meantime, I'll keep trudging along.
Thanks,
Mark