error CS0103

error CS0103: The name 'Categories' does not exist in the current context

code
TableObject table = new TableObject();
FReport = new Report();


table.ColumnCount = 8;

table.RowCount = 2 * 5;

table.Border.Lines =

BorderLines.All;
table.Border.Color = System.Drawing.

Color.Red;
table.Border.Width = 2;

// set column sizes
for (int i = 0; i < table.ColumnCount; i++)
{

table.Columns.Width =

Units.Centimeters * 3f;
}

// set row sizes
for (int i = 0; i < table.RowCount; i++)
{

table.Rows.Height =

Units.Centimeters * 0.5f;
}

table.CreateUniqueName();

// create unique name for the table rows, columns, cells
table.CreateUniqueNames();

DataBand Data1 = new DataBand();
TextObject Text1 = new TextObject();
PictureObject Picture1 = new PictureObject();

FDataSet = new DataSet();
FReport = new Report();
FDataSet.ReadXml(@C:\Program Files\FastReports\FastReport.Net Demo\Demos\Reports\nwind.xml);

Data1.AddChild(table);

FReport.RegisterData(FDataSet, "Categories");
FReport.Prepare();

//

FastReport.Data.

TableDataSource tb = new FastReport.Data.TableDataSource();
tb.ReferenceName ="Categories";
FastReport.Data.Column ReportColumn = new FastReport.Data.Column();
ReportColumn.Name = "CategoryName";
tb.Columns.Add(ReportColumn);

//


Data1.DataSource = FReport.GetDataSource("Categories");
Data1.AddChild(Text1);

Data1.AddChild(Picture1);

Text1.Text = "[Categories.CategoryName]";
Picture1.CanGrow = true;
Picture1.CanShrink = true;
Picture1.Border.Lines = BorderLines.All;
Picture1.Border.Color = System.Drawing.Color.Red;
Picture1.Border.Width = 2;

Picture1.Left = 9;

Picture1.Top = 9;

Picture1.Width = 142;

Picture1.Height = 85;

ReportPage pg = new ReportPage();
pg.Bands.Add(Data1);

FReport.AddChild(pg);

WebReport1.ReportResourceString = FReport.ReportResourceString;

WebReport1.Prepare(); // Error comes here......

// Export report to PDF stream
FastReport.Export.Pdf.

PDFExport pdfExport = new FastReport.Export.Pdf.PDFExport();
using (MemoryStream strm = new MemoryStream())
{

//pdfExport.Producer.
FReport.Export(pdfExport, strm);

// Stream the PDF back to the client as an attachment
Response.ClearContent();

Response.ClearHeaders();

Response.Buffer = true;
Response.ContentType = "Application/PDF";
Response.AddHeader("Content-Disposition", "inline;filename=report.pdf");
strm.Position = 0;

strm.WriteTo(Response.OutputStream);

Response.End();

can someone suggest me something...... how can i resolve it.....

Comments

  • edited 1:30AM
    Can you tell, wich one of code strings gives this error?

Leave a Comment

Rich Text Editor. To edit a paragraph's style, hit tab to get to the paragraph menu. From there you will be able to pick one style. Nothing defaults to paragraph. An inline formatting menu will show up when you select text. Hit tab to get into that menu. Some elements, such as rich link embeds, images, loading indicators, and error messages may get inserted into the editor. You may navigate to these using the arrow keys inside of the editor and delete them with the delete or backspace key.