Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

What happened to my FormatType options?

Status
Not open for further replies.

kkarimi

Programmer
Dec 3, 2010
10
0
0
US
Why is it that I'm only permitted to use a fraction of the export types that are obviously available to me? Take note of the following code (Windows app written in VB.Net via Visual Studios 2008):

Dim crxApp As new CRAXDDRT.Application()
Dim crxRpt As CRAXDDRT.Report

crxRpt = crxApp.OpenReport("D:\MyReport\HANSCOM-PHReBills.rpt")
With crxRpt.ExportOptions


'.FormatType = CRExportFormatType.crEFTText
.FormatType = CRExportFormatType.crEFTRichText

.DiskFileName = "D:\MyReport\Exports\MyExport.rtf"
End With

crxRpt.Export(False)

It works if I use crEFTRichText but I get the following error if I use crEFTText.

"Attempted to read or write protected memory. This is often an indication that other memory is corrupt"

If I alter crxRpt.Export(False) to crxRpt.Export() the system will prompt me with only a handful of export options. But I can tell from the code in the application that I've inherited, it has not always been this way. This used to export using crEFTText (as CSV). Now I can't do that. Please advise.

Note: I'm using craxddrt.dll version 10.5.0.1943
 
Hi,
have you made any changes to the CR installation or to its SDK components/assemblies?



[profile]

To Paraphrase:"The Help you get is proportional to the Help you give.."
 
The list of export options is determined by the list of export dlls installed on that PC. I would guess you are missing some of the dlls.

Ken Hamady, On-site Custom Crystal Reports Training & Consulting
Public classes and individual training.
Guides to Formulas, Parameters, Subreports, Cross-tabs, VB, Tips and Tricks
 
How can I determine the missing assemblies/dlls? Is there in an installation/deployment package specific to these assemblies that I'm missing?
 
Ok so now I'm getting some where (I think). Your blog was exactly the kind of thing I needed.

Looking on my machine I see to directories:

C:\Program Files\Common Files\Business Objects\2.7\Bin
and
C:\Program Files\Business Objects\Common\2.8\bin

I'm guessing the latter is of more significance and just you suggested, I don't have all the DLLs (at least not the one you referenced in your blog).

What is the best way to get those DLLs? I suppose I could search the web for each one and then try downloading them but it seems to me that I should be able to execute some kind of install/upgrade/hotfix or something that would put all of them there. No? What do you recommend?
 
If you own a copy of Crystal Reports you should have all of them on the development PC or at least the ones you chose to install.

Ken Hamady, On-site Custom Crystal Reports Training & Consulting
Public classes and individual training.
Guides to Formulas, Parameters, Subreports, Cross-tabs, VB, Tips and Tricks
 
Ok, my apologies if this sounds extra ignorant...

The code I inherited is using these Crystal Reports in the exact manner I've indicated in my code snippet. This led me to believe that this functionality was bundled up with Visual Studios and that no Crystal Report license was needed. Am I mistaken? Perhaps I am since I can't honestly say how I got the craxddrt.dll on my machine in the first place...I'm not even certain how that directory came to be on my machine.

It's confusing because the previous developer used these controls in previous versions of this application (which he complied with VS2005) and he successfully deployed it to the target machines.

Is it your opinion that he had a license for Crystal Reports and that he had installed a version of Crystal Reports on his machine and that is how he was able to do this?

Looking at his deployment package I see this included in there: CrystalReports10_NET_EmbeddedReporting.msm

 
There is a version of CR that comes with VS2005. According to This link it can export to 7 formats. Are those the ones you are seeing? If you upgrade to the full developer version of CR or to CR 2008 you can incorporate the full list.
 
You're absolutely correct. I looked at the link you provided and the seven formats presented in there

Adobe Acrobat (.pdf)
Crystal Reports (.rpt)
Rich Text Format (.rtf)
Microsoft Word (.doc)
Microsoft Excel (.xls)
HTML 3.2 (.htm)
HTML 4.0 (.htm)

are the exact one I'm being limited to. As it is right now, I am able to export using any of the above options...but at one point the application was able to export using crEFTText (not sure how that would show up i the above list).

So you believe that if I upgrade to "full developer version of CR or to CR 2008" I will have the ability to use crEFTText?
 
Do you know what that format is?

Ken Hamady, On-site Custom Crystal Reports Training & Consulting
Public classes and individual training.
Guides to Formulas, Parameters, Subreports, Cross-tabs, VB, Tips and Tricks
 
I think that particular one is intended to come out as a text export. Then I see another export being done (which also fails) as a CSV export:


I know the goal is to end up as a csv export. Based on the what I see in the code I can only assume it's considered a text export.

' Set the export options.
With crReport.ExportOptions
.CharFieldDelimiter = "|"
.FormatType = CRAXDRT.CRExportFormatType.crEFTCharSeparatedValues
.DestinationType = CRAXDRT.CRExportDestinationType.crEDTDiskFile
.DiskFileName = gblCSVFileName
End With
crReport.Export(False)

I don't know what DDL is associated with the CSV export but I'm fairly certain I'm missing that one as well.
 
Yes it is text, and it should be available if you have full CR.

Ken Hamady, On-site Custom Crystal Reports Training & Consulting
Public classes and individual training.
Guides to Formulas, Parameters, Subreports, Cross-tabs, VB, Tips and Tricks
 
Thank you for your assistance. I will download a trial version and if it resolves my problem, I guess we'll have to make the purchase. I appreciate your time and patience.
 
Hello again Ken,

As you suggested, I have installed CR 2008 (30-day trial) I now see a lot of those extensions in the folder your blog referenced
C:\Program Files\Business Objects\BusinessObjects Enterprise 12.0\win32_x86\

...but I get the same results when I execute my code. I'm still seeing that short list of export options. Is there something else I need to do in addition to installing CR2008? Do I need to run some additional package or script so my project is aware of these new extensions?
 
Did you download the developer components for CR 2008? These are a separate download, I believe.

Ken Hamady, On-site Custom Crystal Reports Training & Consulting
Public classes and individual training.
Guides to Formulas, Parameters, Subreports, Cross-tabs, VB, Tips and Tricks
 
I am not sure what comes with the trial download but if I remember correctly even those of us who purchased the product didn't get the developer tools automatically. I think that was a separate download so it would surprise me if your trial download had those components. Sorry, but I don't have any more details.

Ken Hamady, On-site Custom Crystal Reports Training & Consulting
Public classes and individual training.
Guides to Formulas, Parameters, Subreports, Cross-tabs, VB, Tips and Tricks
 
Hi Ken,

You spent a great deal of time responding to my inquires. Your help was very much appreciated. Any way, I wanted to follow up with you on the solution that I found just in case (in the unlikely event) it comes up again.

The assembly I was using, CRAXDDRT.dll, is not supported any more. I was able to perform the export in the following manner:

//be sure to add these to the top of the page
using CrystalDecisions.Shared;
using CrystalDecisions.CrystalReports.Engine;


reportDocument1.Load(@"C:\_\Report\myReport.rpt");
DiskFileDestinationOptions diskOpts = ExportOptions.CreateDiskFileDestinationOptions();
ExportOptions exportOpts = new ExportOptions();
exportOpts.ExportFormatType = ExportFormatType.CharacterSeparatedValues;
exportOpts.ExportDestinationType = ExportDestinationType.DiskFile;

// set the disk file options
diskOpts.DiskFileName = @"C:\_\Report\myReport.csv";
exportOpts.ExportDestinationOptions = diskOpts;

reportDocument1.Export(exportOpts);

Thanks again for your time and assistance.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top