Click here to Skip to main content
16,004,806 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Note: I am using CR13 with VS 2010.

I am creating winform app.I want to create report dynamically,

I got reference of one of link in which the guy had created report dynamically: http://www.xtremevbtalk.com/archive/index.php/t-248952.html?

I want same thing but i couldn't.I have create my report's instance as EmployeeReport empRpt = new EmployeeReport(); then want to add TextObject as like empRpt.section3.AddTextObject("Print Date: ", 0, 890).But VS2010 gives me error that:

Error 16 'CrystalDecisions.CrystalReports.Engine.Section' does not contain a definition for 'AddTextObject' and no extension method 'AddTextObject' accepting a first argument of type 'CrystalDecisions.CrystalReports.Engine.Section' could be found (are you missing a using directive or an assembly reference?

Any suggestion???
Posted
Updated 15-Oct-13 0:29am
v4

1 solution

It should be:

C#
empRpt.section(3).AddTextObject("Print Date: ", 0, 890)


I hope your definition of EmployeeReport supports all methods of the CR Report definition.
 
Share this answer
 
Comments
Surendrasinh Rathod 16-Oct-13 6:45am    
Thanks for replyI am working on winform c#.when i write emprpt. it disaplays as like section1,section2,section3,section4,section5 not like section(1),section(2),section(3),section(4),section(5).So i write empRpt.section3 but after that i couldn't find property AddTextObject .If you are aware of this type of code.then please give me any sample or inform me what mistake i am doing.???

my code is as following:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using CrystalDecisions.CrystalReports.Engine;
using namespace.Reports;
using CrystalDecisions.ReportAppServer;
using CrystalDecisions.Shared;


namespace namespace.UI
{
public partial class ReportMain : Form
{
private readonly MasterBAL _masterBAL;
public ReportMain()
{
_masterBAL = new MasterBAL();
InitializeComponent();
}

private void ReportMain_Load(object sender, EventArgs e)
{
EmployeeReport empRPT = new EmployeeReport();->This is my already created blank report
empRPT.section3.---------------->here i not find property AddTextObject()
}
}
Mart Rijkers 16-Oct-13 7:15am    
You are using an object called EmployeeReport. I do not know this object. The Sections must be in the definition of this object, as well as the AddTextObject must be. If there is no definition in the object (or it does not inherit from another object), you cannot use it.
Surendrasinh Rathod 16-Oct-13 7:20am    
Thanks.In my original post i have provided one link.in that it have all the properties as like sections & also AddTextObject.I am using new version compare to him.If he can do these all stuff with old versions then why i can't with new ???
Mart Rijkers 16-Oct-13 7:48am    
Your reports Engine seems to be in the CrystalReports definition, since your error contains:
'CrystalDecisions.CrystalReports.Engine.Section'
I think (but I'm surely no VB expert) that in the sample another reference is used:
Set myProject = New CRAXDDRT.Application
Set myReport = myProject.NewReport

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900