Welcome Guest Search | Active Topics | Sign In | Register

asp.net chart not showing in PDF. Options
Muhammad Khan
Posted: Saturday, August 9, 2014 10:01:58 PM
Rank: Newbie
Groups: Member

Joined: 4/2/2014
Posts: 4
Hi, I am trying to convert asp.net chart page to PDF. It shows everything except bars and labels of the chart. Please help. Thanks.
eo_support
Posted: Sunday, August 10, 2014 9:31:54 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,196
Hi,

Can you try to isolate the problem into a test page and post the test page? Once we have that we will take a look and see what we can find.

Thanks!
Muhammad Khan
Posted: Sunday, August 10, 2014 6:47:41 PM
Rank: Newbie
Groups: Member

Joined: 4/2/2014
Posts: 4
CODE BEHIND PAGE****************

protected void btnSubmit_Click(object sender, EventArgs e)
{
EO.Pdf.Runtime.AddLicense("*dummy***");
EO.Pdf.HtmlToPdf.Options.MinLoadWaitTime = 5000;
ASPXToPDF1.RenderAsPDF("test.pdf");
}

I can see chart rendereing completely in my aspx page but when I generate PDF it shows only chart area (not bars).

Thanks
eo_support
Posted: Monday, August 11, 2014 9:23:23 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,196
Hi,

Please try to isolate the problem into a working test page so that we can try to run it here to reproduce problem.

Thanks!
Muhammad Khan
Posted: Thursday, August 14, 2014 10:27:53 AM
Rank: Newbie
Groups: Member

Joined: 4/2/2014
Posts: 4
Hi - I was able to fix this problem by setting viewstate of the asp.net chart control to true.
What actually happens that when I click the button it postbacks page and viewstate being false won't allow chart to be shown in the PDF.
Unlike other .net controls, the viewstate property of chart control is set to false by default .
Enabling viewstate property to true solved the problem.

Thanks
Muhammad
eo_support
Posted: Thursday, August 14, 2014 4:03:22 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,196
Hi,

Glad that you got it working. ASPXToPDF does not require ViewState to function. You can try to think ASPXToPDF as an output redirector: If you comment out RenderAsPDF call in your btnSubmit_Click event and the chart displays correctly on screen, then it should display fine when you call RenderAsPDF.

Thanks!


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.