on 2019 Jun 26 5:44 PM
I need to know (in vb.net) if a bound fieldobject has the property 'TextFormat' set to 'crStandardText' or 'crRTFText'.
I am not able to read at runtime this property. Can someone help me? Thanks
Request clarification before answering.
I don't have it in VB code but Google can help you find sites that can convert C# to VB.
You need to use RAS to get the info
With the ReportClientDocument object use this to determine the type:
CrystalDecisions.ReportAppServer.ReportDefModel.ReportObjects rptObjs;
rptObjs = rptClientDoc.ReportDefController.ReportObjectController.GetAllReportObjects();
foreach (CrystalDecisions.ReportAppServer.ReportDefModel.ReportObject rptObj1 in rptObjs)
{
switch (rptObj1.Kind)
{
case CrReportObjectKindEnum.crReportObjectKindField:
CrystalDecisions.ReportAppServer.ReportDefModel.FieldObject fldObj1;
fldObj1 = (CrystalDecisions.ReportAppServer.ReportDefModel.FieldObject)rptObj1;
btnReportObjects.Text += "Name: " + fldObj1.Name.ToString();
btnReportObjects.Text += "\n Kind: " + rptObj1.Kind.ToString() + "-> " + fldObj1.DataSourceName.ToString() + "\n";
if(fldObj1.FieldFormat.StringFormat.TextFormat == CrystalDecisions.ReportAppServer.ReportDefModel.CrTextFormatEnum.crTextFormatRTFText)
btnReportObjects.Text += "\n RTF: = true";
if (fldObj1.FieldFormat.StringFormat.TextFormat == CrystalDecisions.ReportAppServer.ReportDefModel.CrTextFormatEnum.crTextFormatHTMLText)
btnReportObjects.Text += "\n HTML: = true";
if (fldObj1.FieldFormat.StringFormat.TextFormat == CrystalDecisions.ReportAppServer.ReportDefModel.CrTextFormatEnum.crTextFormatStandardText)
btnReportObjects.Text += "\n Standard Text: = true";
...
Don
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
OK, Thank you very much
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
No, some modules you need to set not to import, that should fix the problem.
The other problem is you may need to fully qualify the call's because both Engine and RAS have the same API's. You'll have to update you qualifiers...
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Don,
Thanks for your fast esponse, but I have a problem. I can't use ReportAppServer in the program because we have imported:
CrystalDecisions..CrystalReports.Engine, CrystalDecisions..ReportSource , CrystalDecisions.shared, CrystalDecisions.Windows.forms
and importing (using) CrystalDecisions.ReportAppServer lead to many errors in other parts of the module. It is possible not to use ReportAppServer to have the same result? Thanks
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
77 | |
30 | |
10 | |
8 | |
8 | |
7 | |
7 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.