Spire.XLS for .NET is a professional Excel .NET library that can be used to any type of .NET( C#, VB.NET, ASP.NET, .NET Core) application, both ASP.NET web sites and Windows Forms application.

Sat Jul 28, 2018 1:11 am

Sorry if this has been asked before.

We have a pre built spreadsheet that we open with Spire.Xls. Set some cells with basic numbers. The spreadsheet has two bar graphs that are built from the spreadsheet. We then save to stream for download as PDF.

Download works!! PDF looks great!! But the bar charts don't have any bars in them.

What is the command to get the bar graphs to render when saving?

Thanks.

ralswede
 
Posts: 4
Joined: Fri Jul 27, 2018 6:22 pm

Mon Jul 30, 2018 2:58 am

Hi ralswede,

Thanks for your post.
After an initial testing with the latest version Spire.XLS Pack Version:8.7.2, I didn't encounter the issue you mentioned. I first suggest you use this verion if you were using old version. If the issue still troubles you, could you please provide us with following information for further investigation ?
1. The input and output document.
2. The full code you were using.
3. The OS and Region information, e.g. Win7 64bit, China/Chinese.
Sincerely,
Hogan
E-iceblue support team
User avatar

hogan.tang
 
Posts: 51
Joined: Tue Jul 03, 2018 1:43 am

Mon Jul 30, 2018 2:13 pm

Version 8.3.0 Which is the latest free version I downloaded from your website Friday. If there is a newer free version download, please provide link. Running Server 2012, 64 bit, asp.net 4.0.

Code:
Workbook workbook = new Workbook();
workbook.LoadFromFile(physicalContantPath, ExcelVersion.Version2010);
workbook.CalculationMode = ExcelCalculationMode.Auto; // does not seem to help

var worksheet = workbook.Worksheets[0];
worksheet.Range["A4"].Value = seat;
worksheet.Range["B4"].Value = group.ToString();
worksheet.Range["C4"].Value = hours.ToString();
worksheet.Range["D4"].Value = los.ToString();
// set more values here blah blah blah

worksheet.PageSetup.FitToPagesWide = 1;
worksheet.PageSetup.FitToPagesTall = 1;
worksheet.PageSetup.Orientation = PageOrientationType.Landscape;
worksheet.PageSetup.IsPrintHeadings = false;
worksheet.PageSetup.IsPrintGridlines = false;
worksheet.PageSetup.BottomMargin = .5;
worksheet.PageSetup.TopMargin = .5;
worksheet.PageSetup.LeftMargin = .5;
worksheet.PageSetup.RightMargin = .5;

var worksheet2 = workbook.Worksheets[1];
worksheet2.PageSetup.FitToPagesWide = 1;
worksheet2.PageSetup.FitToPagesTall = 1;
worksheet2.PageSetup.Orientation = PageOrientationType.Landscape;
worksheet2.PageSetup.IsPrintHeadings = false;
worksheet2.PageSetup.IsPrintGridlines = false;
worksheet2.PageSetup.BottomMargin = .1;
worksheet2.PageSetup.TopMargin = .1;
worksheet2.PageSetup.LeftMargin = .1;
worksheet2.PageSetup.RightMargin = .1;
worksheet2.PageSetup.Zoom = 140;

// Prepare the response
HttpResponse httpResponse = Response;
httpResponse.Clear();
httpResponse.ContentType = "application/pdf";
httpResponse.AddHeader("content-disposition", "attachment;filename=\"" + "file name here............

using (MemoryStream downloadStream = new MemoryStream())
{
workbook.SaveToStream(downloadStream, FileFormat.PDF);
downloadStream.WriteTo(httpResponse.OutputStream);
downloadStream.Close();
}

httpResponse.End();

ralswede
 
Posts: 4
Joined: Fri Jul 27, 2018 6:22 pm

Tue Jul 31, 2018 2:57 am

Hi ralswede,

Thanks for your feedback.
Since we would not update free version, I suggest you use the commercial version(Spire.XLS Pack(Hotfix) Version:8.7.2). If the issue still exists, please share the input document to help us investigate it further. What's more, we could provide a one-month free license of Spire.XLS to you, if you are interested in it, please tell me.
Sincerely,
Hogan
E-iceblue support team
User avatar

hogan.tang
 
Posts: 51
Joined: Tue Jul 03, 2018 1:43 am

Tue Jul 31, 2018 3:08 pm

No change using 8.7. How do I email you the file? I don't want to put it on this form.

ralswede
 
Posts: 4
Joined: Fri Jul 27, 2018 6:22 pm

Tue Jul 31, 2018 5:22 pm

Just using a quick Aspose.Cells demo it work fine so there's nothing wrong with the spreadsheet itself. Seems like your software isn't calculating the graphs before rendering the PDF.

ralswede
 
Posts: 4
Joined: Fri Jul 27, 2018 6:22 pm

Wed Aug 01, 2018 6:14 am

Hi ralswede,

Thanks for you feedback.
To help us look into the issue, please send your input and output document to us via email(support@e-iceblue.com).
Thanks in advance.
Sincerely,
Hogan
E-iceblue support team
User avatar

hogan.tang
 
Posts: 51
Joined: Tue Jul 03, 2018 1:43 am

Return to Spire.XLS