Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
370
Grid caption or band header
posted

Hi,

I am trying to add a grid caption or band header that is taking several lines. So far I haven't been very successful  The grid caption seemed to work OK at first, unfortunately it does not get exported when I export the grid to PDF. The bad header does get exported, however I haven't been able to increase the lines of text  it takes.

Has anybody tried to do something similar?

Thanks,

Matei

  • 469350
    Verified Answer
    Offline posted

    Hi Matei,

    Does it matter to you if the grid header is exporting to PDF in a box that looks like a header?

    If not, then the simplest solution would be to simply write the text into the PDF document before exporting the grid into it. It won't look like a grid header, but I don't know if that matters to you. If it does, then you could probably get it to look pretty close with a little extra code.

    Here's how you would do it:


                string filename = Path.Combine(Path.GetDirectoryName(Application.ExecutablePath), "test.pdf");
                Report report = new Report();
                ISection section = report.AddSection();
                IText text = section.AddText();
                text.AddContent(this.ultraGrid1.Text);
                this.ultraGridDocumentExporter1.Export(this.ultraGrid1, section);
                report.Publish(filename, FileFormat.PDF);
                Process.Start(filename);