This project has moved and is read-only. For the latest updates, please go here.

Group Footer & Main Table Summary Settings

Jan 8, 2015 at 9:05 PM
I saw on a thread where you spoke about the GroupAdded Event which looked like you would be creating a new table. Is there a way to inject HTML into this instead or is there another way to do something similar to the AddGroupHeader with HTML?
Also, if I wanted to use a property from a group in the Overall Summary Settings label, what would be the best approach to get the groups data there?
Jan 8, 2015 at 10:20 PM
Edited Jan 8, 2015 at 10:26 PM
Overall Summary Settings label is not dynamic, but you can inject an arbitrary HTML data at the end of the each group this way:
events.GroupAdded(args =>
        //args.PdfDoc.Add(new Phrase("\nGroup added event."));
        /*var data = args.ColumnCellsSummaryData
                .Where(data => data.CellData.PropertyName.Equals("propertyName")
                           && data.GroupNumber == 1);*/
        var salary = args.LastOverallAggregateValueOf<Employee>(x => x.Salary);
        var table = new PdfGrid(1)
            RunDirection = (int)PdfRunDirection.LeftToRight,
            WidthPercentage = args.PageSetup.MainTablePreferences.WidthPercentage
        var htmlCell = new XmlWorkerHelper
            // the registered fonts (DefaultFonts section) should be specified here
            Html = string.Format(
                     @"<br/><span style='font-size:9pt;font-family:verdana;'>
                         <b>Group <i>added</i> event.</b>
                         Total Salary: {0}</span>", salary),
            RunDirection = PdfRunDirection.LeftToRight,
            CssFilesPath = null, // optional
            ImagesPath = null, // optional
            InlineCss = null, // optional
            DefaultFont = args.PdfFont.Fonts[1] // verdana
        htmlCell.Border = 0;
        table.SpacingBefore = args.PageSetup.MainTablePreferences.SpacingBefore;
Jan 14, 2015 at 4:11 PM

Also, do you have any examples of merging reports without writing them out first? I looked into the .AsPdfStream, but did not quite get what I was wanting. Basically want to create multiple reports in memory and then merge them together before sending the final report in MemoryStream back.
Jan 15, 2015 at 10:23 PM
Jan 16, 2015 at 1:30 PM
Ok, sorry about that but thanks!

Sent via the Samsung GALAXY S® 5, an AT&T 4G LTE smartphone