[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 67
  • Last Modified:

Errors with this c# code

Hi, never used c#, Errors reportedapparently this code should work, but I get the above errors.

private void xtraReport1_AfterPrint(object sender, System.EventArgs e) {
XtraReport report = (XtraReport)sender;
report.ExportToPdf("C:\\Demo\\TestPDF.pdf");
}

Any help appreciated.

Colin
0
colinspurs
Asked:
colinspurs
  • 4
  • 2
  • 2
  • +1
1 Solution
 
p_davisCommented:
There has to be another issue b/c voids don't have returns
0
 
käµfm³d 👽Commented:
Agreed. It would help if you posted the code from lines 69, 70, and 77  = )
0
 
Ken ButtersCommented:
According to your error message 69, 70, 77 are column numbers....

the Line is line 1.   Is the posted code the first line in your C# application?
0
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
käµfm³d 👽Commented:
Oops! I swear I know how to read  ; )

Good catch.
0
 
colinspursAuthor Commented:
For the avoidance of doubt, that's the entire code!

Cheers
0
 
Ken ButtersCommented:
What you have for code above looks like a method.

A method belongs to a class (object).

I would have expected something like this at a minimum:

using System;

class Program
{
    private void xtraReport1_AfterPrint(object sender, System.EventArgs e)
    {
        XtraReport report = (XtraReport)sender;
        report.ExportToPdf("C:\\Demo\\TestPDF.pdf");
    }
}

Open in new window


I don't have XtraReport classes defined in my simple test project... so I get errors because it is unknown for me...
0
 
colinspursAuthor Commented:
Ok, thanks.  It's all wrapped up in a third party application.  I will get advice from the boss and report back Monday!

Cheers for your help.
0
 
colinspursAuthor Commented:
The problem lay with the third party application, it is not a bug in itself.
0
 
colinspursAuthor Commented:
Not a bug.
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

  • 4
  • 2
  • 2
  • +1
Tackle projects and never again get stuck behind a technical roadblock.
Join Now