I am setting up a Schedule control to show planned leave for resources for a business.
As we have quite a large number of resources, we page 100 resources at a time (otherwise the browser will lockup).
This works very well, and is performs well in the browser. An example of our output is here:
Using the example code to export this now to a PDF document, the controller action looks like this (based on samples):
[HttpPost]
public void SchedulePdfExport(string scheduleModel)
{
try
{
PdfExport exp = new PdfExport();
PdfPageSettings ps = new PdfPageSettings(50f)
{
Orientation = PdfPageOrientation.Landscape
};
JavaScriptSerializer serializer = new JavaScriptSerializer();
SchedulePDFExport convert = new SchedulePDFExport();
// Here calling the public method to convert the model values to ScheduleProperties type from string type
ScheduleProperties scheduleObject = convert.ScheduleSerializeModel(scheduleModel);
// Here converting the schedule appointments data into enumerable object by deserializing
IEnumerable scheduleAppointments = (IEnumerable)serializer.Deserialize(Request.Form["ScheduleProcesedApps"], typeof(IEnumerable));
// Here passing the theme values from enum collection
PdfDocument document = exp.Export(scheduleObject, scheduleAppointments, ExportTheme.FlatAzure, Request.Form["locale"], ps);
document.Save("PlannedLeave.pdf", HttpContext.ApplicationInstance.Response, HttpReadType.Save);
}
catch (Exception ex)
{
throw ex;
}
}
The resultant PDF looks like this:
My question is this: I presume that it's trying to drop all 100 resources onto a single page? If so, is there a way to get this to export to multiple pages?
If not, what other workarounds / methods should we look at using? I could always change the page size to something really small (say 20), but then we'd have to export 5 pdfs to get the same result.
Cheers,
Brendan