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

PDF export renders blank pages

1 Answer 258 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Pradeep
Top achievements
Rank 1
Pradeep asked on 11 Jan 2012, 06:06 AM
Hi,

I'm exporting PDF through Telerik Reporting. If I have no data to display (data record count is equal to zero), then I'm doing this:

this.chart1.Visible = false;
this.chart1.Height = Unit.Zero;
  
this.Report.Visible = false;
this.Report.Width = Unit.Zero;
this.Report.Dispose();

But this only displays blank pages; not skipping those pages.
How can I skip the blank pages?

Thanks

1 Answer, 1 is accepted

Sort by
0
Steve
Telerik team
answered on 13 Jan 2012, 04:23 PM
Hi Pradeep,

When the datasource to which the report is bound returns zero records i.e. no data, then none of the report items would display except the chart, which would display with its default RadChart.PlotArea.EmptySeriesMessage.TextBlock.Text value. So hiding the chart would be enough to get an empty report i.e. a single page with only label items (TextBoxes with static text) showing.

The code you've provided works with definition items (see Understanding Events for more info) and using it in events is wrong. Can you specify where you use that code?

If you're still having problems, please provide a project that we can examine.

Greetings,
Steve
the Telerik team

Q3’11 of Telerik Reporting is available for download. Register for the What's New in Data Tools webinar to see what's new and get a chance to WIN A FREE LICENSE!

Tags
General Discussions
Asked by
Pradeep
Top achievements
Rank 1
Answers by
Steve
Telerik team
Share this question
or