Export to text - formatting

Post Author: Ralphred
CA Forum: .NET
Im trying to export a report to a .txt from within a vs2005 program, using CRXIr2. I have been able to export to the text file through code since the option to export to text isn't available for some reason when in vs2005. The problem I have now is that when I try to change the Characters Per Inch Textformatting option they do not change and the report gets exported with the default of 12 characters per inch, and some of my data is cut off.
Here is the code that I am using and would really appreciate if anyone knows a way around this and can help out.
Thanks
Public Sub ExportToText(ByVal ReportName As CrystalDecisions.CrystalReports.Engine.ReportDocument, ByVal ParamName() As String, ByVal ParamValues() As String)
Dim MyReportDocument As CrystalDecisions.CrystalReports.Engine.ReportDocument = ReportName
Dim Field As CrystalDecisions.Shared.ParameterValues
Dim Value As CrystalDecisions.Shared.ParameterDiscreteValue
Try
If Not ParamName Is Nothing Then
For i As Integer = 0 To ParamName.Length - 1
Field = New CrystalDecisions.Shared.ParameterValues
Value = New CrystalDecisions.Shared.ParameterDiscreteValue
Value.Value = ParamValues(i)
Field.Add(Value)
MyReportDocument.DataDefinition.ParameterFields(ParamName(i)).ApplyCurrentValues(Field)
Next
End If
Dim exportOpts As New ExportOptions
Dim diskOpts As DiskFileDestinationOptions
diskOpts = ExportOptions.CreateDiskFileDestinationOptions()
CrystalDecisions.Shared.ExportOptions.CreateTextFormatOptions.CharactersPerInch = 16
exportOpts.ExportFormatType = ExportFormatType.Text
exportOpts.ExportDestinationType = ExportDestinationType.DiskFile
diskOpts.DiskFileName = "c:\exporttotext.txt"
exportOpts.ExportDestinationOptions = diskOpts
'**************************************** Here is where I set and nothing happens
ExportOptions.CreateTextFormatOptions.CharactersPerInch = 16
MyReportDocument.Export(exportOpts)
Catch ex As Exception
MsgBox(ex.Message, MsgBoxStyle.OkOnly, "Print Report")
Finally
MyReportDocument.Close()
MyReportDocument.Dispose()
End Try
End Sub

Yes. Use character styles, and map XML tags to the styles. It's the same process as for paragraph styles.

Similar Messages

  • Crystal report : Export to Text format from BI Launch pad

    Hi,
    We are facing issue in exporting the Crystal report to text format option from BI Launch pad view mode. Currently BI launch pad doesn’t support export to Text format option for crystal report in view mode. But export to text format option is feasible in schedule mode. But customer is not interested in exporting the reports through schedule mode.
    Please advise, if we have any alternative way of exporting the crystal report to text format option from BI Launch pad.
    Thanks,
    Chinnu A

    Hi Chinnu,
    The question is better suited to be asked in the BI Platform space.
    -Abhilash

  • Export to Text format

    When a report is exported to Text format, trailing spaces do not appear in the exported file.
    How do you resolve this issue?
    1. Create a report.
    2. Include 3 fields
    3. Export ->txt
    After the end of 3rd field we require 200 spaces...any idea...

    Try to insert a new formula after the third field like this
    space(200)
    or try to create a formula for the third field like this
    +space(200)
    and place this formula in the place of the third field and export to text file.
    Regards,
    Raghavendra

  • Can I copy/export all text formatted with a given style?

    I have a multi document book, which includes nearly a hundred references to web pages. Each of these is formatted with a character style. The author has not asked me if I can give him a list of all of those references. Is there any way to pull out all text using that character style, and either copy or export it? I already have a TOC and index, but if there is a way to force character styles into either of these, I could do this on a clone just to get the data.
    Failing that, is anyone aware of a way to do this in the resulting PDF or EPUB file?
    (I'm in CS5, by the way!)

    I have a multi document book, which includes nearly a hundred references to web pages. Each of these is formatted with a character style. The author has not asked me if I can give him a list of all of those references. Is there any way to pull out all text using that character style, and either copy or export it? I already have a TOC and index, but if there is a way to force character styles into either of these, I could do this on a clone just to get the data.
    Failing that, is anyone aware of a way to do this in the resulting PDF or EPUB file?
    (I'm in CS5, by the way!)

  • Export to text problem

    <p>Hi ! Everyone,</p><p>I&#39;m using crystal report 7. I report file which is calling from PB. Crystal report display the output properly.</p><p>When I&#39;m trying to export to text format..it exports properly excepts few text columns get TRUNCATES....</p><p>I have checked CharPerInch setting is available for 8.5 onwards .</p><p>for CR7 is there any patch....</p><p> Also i want to suppress "Number and Date Format Dialog" dialog box which appears exporting to crystal report to CSV format</p><p>could you help?</p><p>Thanx ....</p><p>Vishwas</p>

    I am assuming PB is Power Builder. The issues with PB in CR 7 was that PB could get structure sizes properly. The fix was to build and app using MS C++, run in debug mode and get the actual size required and add that value to PB.
    Also, CR 7 is well past it's life cycle so we have no more samples or patches available.
    Please upgrade to a develoment tool that supports .NET Assemblies and CR Xi R2 or above.

  • Export to text removes trailing spaces in XI R2

    I've found an article that talks about the problem of the export to text removing trailing spaces, but the article mentions that this is fixed in Crystal Reports XI with a newer version of u2ftext.dll to version 11.0.0.941.
    [1218375 - Trailing spaces ignored when exporting to Text format|http://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/oss_notes_boj/sdn_oss_boj_erq/sap(bD1lbiZjPTAwMQ==)/bc/bsp/spn/scn_bosap/notes%7B6163636573733d36393736354636443646363436353344333933393338323636393736354637333631373036453646373436353733354636453735364436323635373233443330333033303331333233313338333333373335%7D.do]
    I'm using Crystal Reports XI R2 and my u2ftext.dll version is already 11.5.11.1470.
    I'm I missing something or is there another solution to the issue in XI R2?
    Thanks,
    Jeff

    2 Years, multiple people are asking this question.......Does anyone in support have a response for keeping the trailing spaces intact during export?

  • IBooks export to text - nothing get's exported...why?

    Hi.
    I have created a small iBook with iBooks Author - with some text, pictures etc.
    I would like to export it to text - so trying to do so results in no text file created - nothing gets exported.
    Any idea why - and what to check?
    Best regards
    Jens

    Post Author: quafto
    CA Forum: .NET
    The version of Crystal Reports that comes with Visual Studio .NET 2005 does not allow you to export to Text format. In order to upgrade to XI R2 you must own a copy of the Developer edition of Crystal Reports XI R2. From your post above you seem to have the Professional edition.You won't see the additional formats until you install Developer edition.

  • Why Acrobat x professional is changing the text formatting specifically the font family  and the font size of the text in my pdf on exporting it to Microsoft word file format ?How should i stop Acrobat x professional from doing that so that i get an exact

    Why Acrobat x professional is changing the text formatting specifically the font family  and the font size of the text in my pdf on exporting it to Microsoft word file format ?How should i stop Acrobat x professional from doing that so that i get an exactly same word file on exporting it from its pdf counterpart?

    I was testing the preciseness & efficiency of Adobe acrobat x professional's doc conversion capabilities. As i have to take a document editing project in future which is going to need lot of pdf to word and vice versa conversions . What I did was I created a test word document converted into a pdf using a pdf maker in my word 2007 , Acrobat did convert the document from word to pdf keeping everything in the source file intact , However when i tried the other way round and attempted to convert the same pdf to word 2007 file format I lost my formatting ?So the font that I used to create the pdf are the ones taken from word 2007 which i believe is using the fonts that are installed in my computer. Any suggestions on how to preserve the formatting of the document after converting it from pdf to word file format?
    Regards
    Mike

  • Exporting crystal in text format

    HI Experts,
    I am trying last three days to export my crystal report in text file, using crystal report RPT i cant see the text file format. I can see the Rich text format but i want the report to export .txt format so user can view the report through notepad application.
    I have tried using CRAXDRT.DLL to export the report in text fomat, i got suceed in the machine SAP is not installed but when i am trying to run the same program on the machine were SAP is installed it is giving me error "ActiveX component cannot create object" when i run the application through VB.
    When i try running the code through .Net appliaction (C#/.Net) it gives me error "System.Runtime.InteropServices.COMException: Retrieving the com class factory for component with CLSID {-some ID--}" failed due to following error: 800736b1. I am not sure why it is not working i got totally lost... Can you please help to get out of this?
    Can some one provide me the sample code to export the report in the text file.
    Looking forward for your help!
    Regards,
    Naresh

    Ensure same version of crystal report is installed in the target machine, if needed uninstall, test , and install again to detect the issue and update this thread.

  • Export report in text format

    Hi.
    I am still downloading the trial ver of cr 2008, but I would to know urgently that if it is possible to export report in utf-8 text format given the data is retrieved from ms/sql table in ucs-2 format
    Many Tks

    Hi,
    yes it is possible to export a report in text format.
    U just need to do a bit formatting for that.(only for display pupose)
    Regards,
    Misra P.

  • How can I export to Text and/or CSV format and get correct page info?

    I am using CRVS2010 to upgrade an application from CRXI RDC to .Net.  When at runtime I generate the report and export to Text or CharacterSeparatedValues my page footers show Page -1 of 1.  Using the CRXI RDC, I see the correct page info in the footers.
    When I export to Text, I get the Page -1 of 1 for every page.  If I set LinesPerPage to zero, then I get it all on one page, which still has Page -1 of 1 at the end.
    If I export to CSV, I get Page -1 of 1 for every line.  If I use the viewer to review the report at runtime, and export from there, I cannot export as Text so I have no comparison.  However, the Export to CSV from the Viewer as Page -1 of 1for every entry just as my export does.
    What do I need to do to get the correct line info?  What is that is different from CRXI RDC and CRVS2010 .net that would impact this behavior?

    Yes, I am using SP2 for VS 2010 and I'm using the Page N of M formula in the page footer.  While my export code was not quite as simple as yours, I did it both ways in my test program with the same results.  A one page report whose footer says Page -1 of 1.
    Here's the relative code snippet:
    #if 0
        CrystalDecisions::Shared::ExportOptions ^exportOptions = gcnew CrystalDecisions::Shared::ExportOptions();
        exportOptions->ExportDestinationType = CrystalDecisions::Shared::ExportDestinationType::DiskFile;
        exportOptions->ExportFormatType = CrystalDecisions::Shared::ExportFormatType::Text;
        TextFormatOptions ^textFormatOptions = exportOptions->CreateTextFormatOptions();
        textFormatOptions->LinesPerPage = 0;
        textFormatOptions->CharactersPerInch = 11;
        exportOptions->FormatOptions = textFormatOptions;
         CrystalDecisions::Shared::DiskFileDestinationOptions ^diskFileDestinationOptions = exportOptions->CreateDiskFileDestinationOptions();
         diskFileDestinationOptions->DiskFileName = gcnew System::String("c:\temp\test.txt");
         exportOptions->DestinationOptions = diskFileDestinationOptions;
        thisReport.Export(exportOptions);
    #else
        thisReport.ExportToDisk(CrystalDecisions::Shared::ExportFormatType::Text, gcnew System::String("c:\temp\test.txt"));
    #endif
    Edited by: nlDevotie on Jan 9, 2012 11:59 PM

  • Export to Text File

    Post Author: hepburn
    CA Forum: Exporting
    I'm using Visual Studio 2005 Team Suite which I believes has Crystal Reports 10 installed.I'm trying to export to a text file. Here's the code I have so far:        DiskFileDestinationOptions diskOpts =        ExportOptions.CreateDiskFileDestinationOptions();        // set the export format        ExportOptions exportOpts = new ExportOptions();        exportOpts.ExportFormatType =           ExportFormatType.RichText;        exportOpts.ExportDestinationType =           ExportDestinationType.DiskFile;                diskOpts.DiskFileName = AbsolutePath("c:/pleasework.txt");        exportOpts.ExportDestinationOptions = diskOpts;        _crReportDocument.Export(exportOpts);Is RichText the only text option I have?? I've been googling and it sounds like I may need to install a dll to export to text. Can anyone confirm that?Thanks much...

    <BLOCKQUOTE><font size="1" face="Verdana, Arial, Helvetica">quote:</font><HR>Originally posted by David Brown ([email protected]):
    Liv,
    Just tried with an individual file export and this worked. What are you trying to export?
    David<HR></BLOCKQUOTE>
    null

  • Export to Text failing when Report height is more than 23 inches

    I have a problem while exporting to Text, when report height is more than 23 inches. It's failing with "an unhandled exception occurred in crw32.exe [3856]"
    Both Crystal Reports 2008 and Crystal Reports XI Release 2 are failing. Export to PDF is working fine.
    I am trying to design a lengthy report and export to text.
    I searched in forum with out any results.
    It would be great, if some body can point me in right direction. Thank you.
    Regards,
    Raveendra

    Hi Raveendra
    To work around this error message, disable DEP by performing the following steps:
    1. Click Start > Settings > Control Panel.
    2. Double-click 'System'. The "System Properties" dialog box appears.
    3. Click the 'Advanced' tab.
    4. Click 'settings' under 'performance'.
    5. Click the 'Data Execution Prevention' tab
    6. Select 'Turn on DEP for all programs and services except those I select:'.
    7. Click 'Add'.
    8. Browse for the application CRW32.exe. This file is located in:
    C:\Program Files\Business Objects\Crystal Reports 12\
    9. Select CRW32.exe and click 'Apply'.
    10. Click 'OK' to close the 'System Properties' dialog box.
    11. Log on as an Administrator and start Crystal Reports.
    Now try to export report to the text format and observe the behavior.
    Regards
    Girish Bhosale

  • Many problems with the 'Export to Text' (.txt) in CR Xi

    Hi,
    I have listed many problems with the 'Export to Text' (.txt) function of CR Xi.
    These problems are related to this export format only (meaning everything works fine in the Viewer or in the 'Export to PDF')...
    - Multi-columns layout do not export as Multi-column (export only a one column);
    - Numeric values with parenthesis for negative values or with a fix currency sign at the leftmost position are not exported correctly;
    - Fields having a Suppress formula which is "WhilePrintingRecords" do not appears when exported;
    - Fields with 'Suppress double value' checked are not always suppressed when exported to Text.
    - 'Keep Group Together' flag is not working.
    - 'Reset Page Number After' simply does not works when exported to text;
    - 'Keep object together' on TextBox/Section is not working.
    - Whenever a group is ending on the last line of a page, the the following page as the same Group header as the previous group with no records until the page is filled, then the PageBreak and PageHeader is missing but the records of the following group appears.
    I would like to know what is the status of the 'Export to Text' function (is it a deprecated function not supported anymore???).
    If still supported, when will these bugs be fixed???
    Thanks

    Hi Rene
    Export to Text is supported till date. Crystal Reports 2008 also supports this with Keep together working however when I tried with format with multiple columns, it didnot show up in the exported text file.
    Regards
    Sourashree

  • Java run time export to text does not run but PDF did

    My line of code is -
    ByteArrayInputStream byteArrayInputStream = (ByteArrayInputStream)reportClientDoc.getPrintOutputController().export(ReportExportFormat.PDF);
    I used Eclipse to generate the .jar file and that line of code worked.
    I am switching from EDM to OnBase for an image storage system. OnBase does not support .pdf. They wanted the file as a text format.
    I typed (ReportExportFormat.TXT) and got an error. The 'Quick Fix' suggested I use (ReportExportFormat.text), so I did.
    The code generated no errors, but when I ran the code nothing was generated.
    The Crystal Report I used to generate the report was Crystal Report 2008.
    I noticed the list of Crystal Report supported export formats and 'text' is not one of those.
    What are the supported formats for Crystal Reports 2008?

    The Crystal Reports Java engine doesn't support Text output.
    Closest would be CSV, but that output form is data-centric.
    Sincerely,
    Ted Ueda

Maybe you are looking for

  • One email account on two computers

    With the help of someone on these forums I have just set up a wireless network using Appl AirPort Extreme. I use Microsoft Entourage on both machines both using the same account. When I receive an email, it appears in the in-box of whichever of the t

  • Error Page with my own Error Message based on table

    <p class="MsoNormal"><span style="" lang="EN-AU">Hi All<o:p></o:p></span></p> <p class="MsoNormal"><span style="" lang="EN-AU">I want to share my code (based on Apex_Lib code. Thanks Patrick) , maybe can help somebody else<o:p></o:p></span></p> <p cl

  • I need better performance from my computer. Could someone point me in the right direction?

    I do a lot of video editing for work. I am currently using the Creative Cloud, and the programs I use most frequently are Premiere Pro CS6, Photoshop CS6, and Encore. My issue is that when I am rendering video in Premiere Pro, and most importantly, t

  • Problem with BDOCS Business Partner CRM - PSCD(R/3)

    I have a problem with BDOCS (Middleware, Data Exchange Synchronization). I configured only Synchronization for Business Partner Type “2” Organization and “3” Group”(In the Initial Load).  However, when PSCD add or modify “Identification Number” (tabl

  • Creating activity failed

    Hi All, I am unable create activity while creating DC. I have NWDI Developer role it has the required UME Actions. So I thought to add privileges to the ACL. When I am try to add the permissions to the track as per following sap help link (Step 5) th