This is a migrated thread and some comments may be shown as answers.

Feature background image stopped being displayed

5 Answers 284 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Jose Ronaldo
Top achievements
Rank 1
Jose Ronaldo asked on 09 Sep 2014, 12:07 PM
We performed the upgrade version of Telerik Reporting Q1 2010 to 2014, but the background image resource, defined by the Report.Style.BackgroundImage.ImageData property, of the report it ain't been displayed in all sections of the document. 
After some research, we've became aware that some changes occurred in this functionality and the Report.PageSettings.BackgroundImage.ImageData property should be used instead. But even defining the background image in PageSettings, the sessions of the document which are not PageHeader and PageFooter didn't showed the background image.  
 
Some sessions of the Report, as the ReportFooterSection are displayed dynamically, so it is not possible to divide the background image into pieces to fill each session.
Also, it isn't possible use the feature PrintPreview, because the generation of the report occurs without user interaction. 
 
We saw that in http://www.telerik.com/forums/backgroundimage thread is suggested a solution using watermark. How should the report be configured to work with the watermark? We defined the watermark in Report.PageSettings.Wattermark as it follows: 
Opacity as 1, 
Sizing as ScaleProportional and 
Position as Behind. 
 
Still the same problem occurred: the watermark is only displayed at the sessions of the page, not at report sessions. 
 
Is there any solution available for this problem?
 
Reagards.

5 Answers, 1 is accepted

Sort by
0
Nasko
Telerik team
answered on 09 Sep 2014, 02:13 PM
Hello Jose,

The Report.Style.BackgroundImage will not be displayed in the Page Header and Page Footer sections. In order to set a background image for the whole report you need to use the Report.PageSettings.BackgroundImage property and configure the report viewer in your application programmatically to start in Print Preview layout by default (no user interaction is needed for this).

Note that you can see watermarks only in Print Preview layout of the report viewers and when printing or exporting. Thus, the watermark won't help you in the current situation. For more information, please refer to the Watermarks help article.

Regards,
Nasko
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
0
Jose Ronaldo
Top achievements
Rank 1
answered on 17 Nov 2014, 06:05 PM
Hi Nasko, 

I've set the Report.PageSettings.BackgroundImage property, but I' ve found difficulty in configuring the report viewer as Print Preview, because i'm not using a ReportViewer object. Instead I'm using a ReportProcessor.

Here's a sample of the current PDF generation:

    ReportProcessor reportProcessor = new ReportProcessor();
     RenderingResult result = reportProcessor.RenderReport("PDF", this, null);
     
     using (FileStream fs = new FileStream(fileName, FileMode.Create))
     {
          fs.Write(result.DocumentBytes, 0, result.DocumentBytes.Length);
          fs.Close();
     }


As I've said, this routine is triggered by an internal thread and the user doesn't informs where the file will be generated. After some research, I' ve seen that ReportViewer class from Telerik 2014 Q3 has a method called ExportReport which, according to the documentation, opens a dialog window. This wouldn't be a valid solution in my case, because the user shouldn't interact with the application.

I wonder if isn't there another way of saving the report with Telerik Q1 2014 in a wpf application presenting a background image that covers the whole report. If it is possible to do that using the ReportProcessor class or using the ReportViewer class, would you, please, send me a sample of code? 

Regards.







0
Nasko
Telerik team
answered on 20 Nov 2014, 02:40 PM
Hello Jose,

The PDF format is a page oriented format. The Report.PageSettings.BackgroundImage will be shown automatically in the PDF and you don't need to set any of the viewer's properties in this case.
Attached you can find a sample project which exports a report to PDF with a background image applied to it.

Regards,
Nasko
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
0
Jose Ronaldo
Top achievements
Rank 1
answered on 22 Nov 2014, 12:25 PM
Hi, Nasko. 
 
The solution provided in the sample project does not solve the problem.
As seen in my project, the background image isn't shown in the Detail, in the GroupHeader and in the ReportHeaderSection of the sent sample, either. 
I've attached an image of the report generated by the sample to ilustrate the problem. 
 
I reiterate that I have defined the background image in PageSettings of my project, but the document sessions which are not PageHeader and PageFooter do not show the background image.
 
Is there a way of presenting a background image that covers the whole report in Telerik Q1 2014 for a WPF application? If you may, please, send me a code sample.
 
Regards.
0
Nasko
Telerik team
answered on 26 Nov 2014, 03:56 PM
Hello Jose,

Set the section's Style.BackgroundColor = Transparent instead of White. This setting will show the report's background behind the report sections.

Regards,
Nasko
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
Tags
General Discussions
Asked by
Jose Ronaldo
Top achievements
Rank 1
Answers by
Nasko
Telerik team
Jose Ronaldo
Top achievements
Rank 1
Share this question
or