|
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.
|
|
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!
|
|
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
|
|
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!
|
|
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
|
|
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!
|
|