0

enter image description here

setting the footer..

in the above screen the footer is displayed after new member report and reporting period but i dont want like this

I'm working on windows application using C#.

I have generated the "Report" using Ms chart control. While printing and exporting into XPS format, Header and Footer are appearing its fine . But i want the Footer will be displayed at the bottom of the report at present it was appearing just after the header, I want to add this Footer at the bottom using C#. So user can print page with Header and Footer. How to do this.

can any one have idea about this ..

Many thanks....

this is my code

     Title maintitle = kpiChartControl.Titles.Add("New Members Report" + Environment.NewLine);


  maintitle.Alignment = ContentAlignment.TopLeft;
  maintitle.Font = new Font(FontFamily.GenericSansSerif, 11, FontStyle.Bold);

  Title rangetitle = kpiChartControl.Titles.Add(string.Format("Report period from : {0} to {1}{2}", dStartDate.Value.ToString(xxx.dateFormat),
    denddate.Value.ToString(xxxx.dateFormat), Environment.NewLine));
  rangetitle.Alignment = ContentAlignment.TopLeft;
  rangetitle.Font = new Font(FontFamily.GenericSansSerif, 11, FontStyle.Bold);


  Title footertitle = kpiChartControl.Titles.Add("--------------------------------------------------------" + Environment.NewLine);
  footertitle.Alignment = ContentAlignment.BottomCenter;

  Title gompanytitle = kpiChartControl.Titles.Add("xxxx");
  gompanytitle.Alignment = ContentAlignment.BottomLeft;
  gompanytitle.Font = new Font(FontFamily.GenericSansSerif, 9, FontStyle.Regular);

  Title printedby = kpiChartControl.Titles.Add(string.Format("Printed By ("+text+") On :{0}", dt,Environment.NewLine));
  printedby.Alignment = ContentAlignment.BottomRight;
  printedby.Font = new Font(FontFamily.GenericSansSerif, 9, FontStyle.Regular);


  kpiChartControl.Printing.Print(true);

  kpiChartControl.Titles.Remove(maintitle);
  kpiChartControl.Titles.Remove(rangetitle);
  kpiChartControl.Titles.Remove(footertitle);
 kpiChartControl.Titles.Remove(gompanytitle);
 kpiChartControl.Titles.Remove(printedby);
user682417
  • 1,478
  • 4
  • 25
  • 46

2 Answers2

2

The trick is to use the Docking property. So for all items that you wish to place below the graph, do the following

printedby.Docking = Docking.Bottom;
gompanytitle.Docking = Docking.Bottom;
footertitle.Docking = Docking.Bottom;
zeFrenchy
  • 6,541
  • 1
  • 27
  • 36
0

I'm kinda guessing here to be honest - but it seems to me that you need to be adding the footer in the XPS document, rather than as part of the chart. My guess is that the chart will always by displaying titles at the top.

This SO - about adding header/footer to an XPS - should help: add footer to FlowDocumentsdocuments, both Sauron's and Vikram's answers there should provide the information you need.

Community
  • 1
  • 1
Andras Zoltan
  • 41,961
  • 13
  • 104
  • 160