Hello,
I am having problems with chart creation. When I try to insert chart generated by DynamicPDF into PDF document, following error occur in DrawToWeb method:
<pre>
[ArgumentOutOfRangeException: Length cannot be less than zero.
Parameter name: length]
System.String.Substring(Int32 startIndex, Int32 length) +172
ceTe.DynamicPDF.PageElements.Charting.Axes.NumericXAxis.a(Single A_0, Single A_1)
ceTe.DynamicPDF.PageElements.Charting.Axes.NumericXAxis.CreateAxisLabels()
ceTe.DynamicPDF.PageElements.Charting.Axes.XAxisList.g()
ceTe.DynamicPDF.PageElements.Charting.Chart.b()
ceTe.DynamicPDF.PageElements.Charting.Chart.Layout()
ceTe.DynamicPDF.PageElements.Charting.Chart.DrawRotated(PageWriter writer)
ceTe.DynamicPDF.PageElements.RotatingPageElement.Draw(PageWriter writer)
ceTe.DynamicPDF.PageElements.Group.Draw(PageWriter writer)
ceTe.DynamicPDF.Page.b(PageWriter A_0)
ceTe.DynamicPDF.Page.DrawEntries(DocumentWriter writer, Int32 pageNumber, Int32 sectionPageNumber)
ceTe.DynamicPDF.Page.a(DocumentWriter A_0, Int32 A_1, Int32 A_2, Int32 A_3)
zz93.el.d(Int32 A_0)
zz93.el.x()
ceTe.DynamicPDF.Document.Draw(Stream stream)
ceTe.DynamicPDF.Document.a(HttpRequest A_0, HttpResponse A_1, Boolean A_2, String A_3, Boolean A_4)
ceTe.DynamicPDF.Document.DrawToWeb(Boolean allowBrowserCaching, String downloadAsFileName, Boolean forceDownload)
ceTe.DynamicPDF.Document.DrawToWeb(String downloadAsFileName)
Web_CSharp.GeneratorExamples.LineChartSample.Page_Load(Object sender, EventArgs e) in c:\inetpub\wwwroot\pdfgenerator\linechartsample.aspx.cs:33
System.Web.UI.Control.OnLoad(EventArgs e)
System.Web.UI.Control.LoadRecursive()
System.Web.UI.Page.ProcessRequestMain()
</pre>
This error shows everytime, even if I use official (and functional) example from this site (or documentation) without change. I use framework 1.1 but in 2.0 it happens too.
Please, can anyone help me? I would really appreciate it.
Problem with charts
Re: Problem with charts
Support · Jul 31, 2008Hello,
We are able to run the pie chart examples from our help documentation using .NET Framework v1.1 and v2.0 without any problem. What build of our product are you using? Can you please try the latest dll downloading from our CustomerArea
by logging in using your current serial number. Refer the latest dll files in your application and see if it solves your problem.
If you don't have the serial number you can download the latest Evaluation Edition dll files from our website
.
If you still get the error then please send over a sample code which will give error to our [^a|mailto:support@cete.com|Support Team^] so that they can take a look into it further.
Thanks,
ceTe Software Support Team.
Re: Problem with charts
Forum member · Jul 31, 2008Thank you for answer.
I am using Evaluation version of DynamicPDF Generator v5.0.1 in order to find out if your chart/pdf tools are sufficient for our company´s project.
I tried even the most basic C# example in documentation (chapter "Charts"). Any advice would be appreciated.
ASPX:
<%@ Page language="c#" Codebehind="LineChartSample.aspx.cs" AutoEventWireup="false" Inherits="Web_CSharp.GeneratorExamples.LineChartSample" %>
CS:
using System;
using ceTe.DynamicPDF;
using ceTe.DynamicPDF.PageElements.Charting;
using ceTe.DynamicPDF.PageElements.Charting.Axes;
using ceTe.DynamicPDF.PageElements.Charting.Series;
namespace Web_CSharp.GeneratorExamples
{
/// <summary>
/// Summary description for LineChartSample.
/// </summary>
public class LineChartSample : System.Web.UI.Page
{
private void Page_Load(object sender, System.EventArgs e)
{
Document document = new Document();
Page page = new Page();
document.Pages.Add(page);
Chart chart = new Chart(0, 0, 400, 200);
IndexedBarSeries barSeries1 = new IndexedBarSeries("Website A");
chart.PrimaryPlotArea.Series.Add(barSeries1);
barSeries1.Values.Add(new float[] { 5, 7, 9, 6 });
IndexedBarSeries barSeries2 = new IndexedBarSeries("Website B");
chart.PrimaryPlotArea.Series.Add(barSeries2);
barSeries2.Values.Add(new float[] { 4, 2, 5, 8 });
IndexedBarSeries barSeries3 = new IndexedBarSeries("Website C");
chart.PrimaryPlotArea.Series.Add(barSeries3);
barSeries3.Values.Add(new float[] { 2, 4, 6, 9 });
page.Elements.Add(chart);
document.DrawToWeb(@"C:\Temp\Simplechart.pdf");
}
#region Web Form Designer generated code
override protected void OnInit(EventArgs e)
{
//
// CODEGEN: This call is required by the ASP.NET Web Form Designer.
//
InitializeComponent();
base.OnInit(e);
}
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.Load += new System.EventHandler(this.Page_Load);
}
#endregion
}
}
Re: Problem with charts
Support · Jul 31, 2008Hello,
We are able to run the code you have sent without any problem using our product. Please try uninstalling the DynamicPDF product from your system and install the product again by downloading from our website
and see if it solves your problem.
Thanks,
ceTe Software Support Team.
Re: Problem with charts
Forum member · Jul 31, 2008Hello
Still nothing :(
Is there a possibility that I have missed some mandatory setting somewhere (in web.config for example)?
Looking foward to your reply
Michal Kucera
Re: Problem with charts
Support · Jul 31, 2008Hello Michal,
What build dll of our product are you using? Please check the build number for the dll you are having in the Bin folder of your application. You can find the build number by right clicking the dll --> go to Properties --> click on Version tab --> in the Comments section. Please tell us this build number.
Thanks,
ceTe Software Support Team.