Error inExportToDisk method for Excel (nvalid export DLL or export format)

Hi,
I'm new to Crystal Reports and facing a problem with its ExportToDisk method. I'm using Crystal Reports 2008 with MS .Net v3.5 SP1. I get the below error while trying to export to a Excel file. The Datasource is a dataset. Could you please help me out?
-Stack Trace 
at CrystalDecisions.ReportAppServer.ConvertDotNetToErom.ThrowDotNetException(Exception e)
   at CrystalDecisions.ReportSource.EromReportSourceBase.ExportToStream(ExportRequestContext reqContext)
   at CrystalDecisions.CrystalReports.Engine.FormatEngine.ExportToStream(ExportRequestContext reqContext)
   at CrystalDecisions.CrystalReports.Engine.FormatEngine.Export(ExportRequestContext reqContext)
   at CrystalDecisions.CrystalReports.Engine.ReportDocument.ExportToDisk(ExportFormatType formatType, String fileName)
-Error message
Error in File stdiface {3C162A12-5142-4F2C-8709-154FDD0843DB}.rpt:
Invalid export DLL or export format.
-Exception source
CrystalDecisions.ReportAppServer.DataSetConversion
-Error ID
InvalidExportOptions
Any help will be appreciated!
Thank You!

Further, our application has recently upgraded to Crystal Reports 2008, and this problem wasn't observed on any of the previous versions.
Let me summarize the findings as follows:-
1)When I install my application on a clean XP machine, (which installs Crystal Reports 2008) as a prerequisite, the window service which uses the ExportToDisk method of Crystal Report engine works without a hitch. The report is successfully generated.
2)However, if I install my application on a machine which had previous version of my application installed (which used Crystal Reports 10) it gives me a problem with the ExportToDisk method (Invalid export DLL or export format) when it's called through a windows service.
Let me know if you need any additional information.
Do help!
Thanks!

Similar Messages

  • Error executing BPC for Excel

    Hi BPC Friends
    Until Yesterday I have executed without problem BPC Administration and BPC for excel.
    Yesterday I have execute the package to load the data for a dimension (masterdata).
    Now using my account I can open BPC Administration but If I try to execute BPC for excel, when I select an application the system give me this message:
    object variable or with block variable not set
    but if I execute the BPC for excel with another account It works.
    Could you please help me?
    thanks
    regards
    Michele Medaglia

    thanks.
    I have done the process but it doesn't work.
    You said me:
    if you imported a secure dimension then you have to process the security to have the right profiles for each user and member access profile.  "
    How Can I do this activity?
    Why with another account I don't have this problem?
    thanks
    regards
    Michele Medaglia

  • Waiting error with BPC for Excel on Citrix

    Good day,
    We are currently running SAP BPC 5.1 SP 7 (release 5.0.508.03)
    On Production and Staging , users running BPC client on our Citrix environment are experiencing a "WAITING" message when submitting on input schedules on BPC Excel after working or leaving the input schedule idle for more than +/- 10 minutes.
    We currently only experience the problem on BPC clients running on Citrix. The BPC clients running via the LAN is not experiencing this problem and we cannot replicate the problem on the LAN
    We asked our Network team to investigate they found that there was a network reset connection (RST, ACK) from the BPC Client on Citrix to the Application Server after 1 minute and 5 seconds of refreshing the input schedule.             
    Steps for Reconstruction          
    1.User running BPC for excel client on our Citrix environment.
    2.logs onto BPC for Excel.
    3.Opens and refresh's an input schedule in BPC for Excel.
    4.Works on or leaves the input schedule idle for 10-15 minutes.
    5.Submits on the input schedule after 10-15 minutes
    6.Receives a "WAITING" message in the top left hand corner for the excel for BPC screen.
    7."WAITING" message runs indefinitely.
    Notes:
    1.We can reproduce this on our Citrix Staging environment and currently experience this problem on our Citrix Staging and Production environment. The problem cannot be reproduced when a BPC client connects  via the LAN for Staging and Production.
    2.Citrix session remains active and connected during the above steps.
    3.The only way the "WAITING" message is stopped is if the users selects refresh or submit on the input schedule after a few minutes, the refresh then runs successfully, but the Submit does not go through successfully.
    4. We have asked or Citrix team to investigate and they cannot find anything that could be causing the problem.
    Any ideas?
    Thanks,
    Peter Bellis

    ok.
    In this case it seems you have a problem with antivirus or forewall into Citrix server which is blocking the communication with application server.
    I expect to be more like antivirus which is blocking actually the activity of add ins from excel whoich measn the BPC client.
    So actually your problem has nothing to do with Cittrix is just a pure problem with installation of client into that machine (in your case citrix server).
    So I suggest to disable any antivirus or firewall into that citrix server for test purpose and afte that you have to make sure that you don't have any restrictions on port 80 if this is used by BPC.
    Regards
    Sorin Radulescu

  • Compilation error and method for inheritance

    1.I've tried to construct @create table for an entity.an error occurs which is:
    'Warning: Type Body created with compilation errors.'
    Why and how to solve it?
    2.as oracle 8 does not support inheritance,the other method would be through nested table.what else could it be?

    stop and start the siebel server will solve.
    Regards
    Ahmed

  • F110 Error-Pymt Methods for This Run Not Specified in Master Record

    Hi,
    I have encountered an issue where the payment program will not determine the payment method correctly.  We have several company codes assigned to a single paying company code.  We do not enter a payment method on the invoice.  The payment method is determined from the vendor master during the execution of F110. We have two different payment methods C and A.  The vendor is extended to multiple company codes and each company code can choose either payment method A or C. 
    Following is an example:
    CoCd     Vendor  PM
    1000     123         C (paying company code)
    2000     123         C
    3000     123         A
    4000     123         A
    If I execute F110 for payment method C, for vendor 123 and only include company codes 1000 and 2000, the payment program includes the invoices for payment as expected.  The same is true for payment method A with company codes 3000 and 4000. 
    We are trying to move towards a centralized AP payment run.  However, if I execute F110 for payment method C, for vendor 123 for all company codes (1000, 2000, 3000, 4000), the payment program has ALL the invoices set to exceptions.  If I review the Additional Log for Pmnt Method Selection if Not Successful it states: "None of the pmnt meths "C" has been entered in mast.rec.or in doc."  Message No. FZ605.  I would expect SAP to include the invoices from company code 1000 and 2000 for payment and the invoices from company codes 3000 and 4000 as exceptions because the payment method does not exist in the invoice or the master record.
    Does anyone have any ideas on how to resolve this issue?  Thank you in advance for your assistance.
    Sue

    Hi
    Friends,
    Check the Config FBZP properly
    1. Payment mentd in country-C (Check) select details button check whether this is maintained
    Select checkl box-Street PO, Box, pst code. in required master data specification Tab
    RFFOU_C
    LISTIS
    2. Payment methd in company code-A (ACH) select details button check whether this is maintained
    select check box Bank details required master data specification Tab
    RFFOEDI1
    LIST1S
    3. XK01 - Give Payment methd (AC) and also give Bank details in payment transaction tab.
    4.F110- Give payment metnd A or C depends upon your requirement.
    Go to SE11-PAYR, SE38-RFFOUS_C-----Check
    Goto SE38-RFFOEDI1----ACH
    Anil

  • Best Method for Importing and Exporting Data to a local 'resrouce'  file

    I've searched the forum, and seen glimmers of hope to what I am trying to piece together - but not in a concise way that will sink into my brain.
    Using Javascript on a PC for IDCS2, I'm writing a simple script that has a user interface.
    I'd like to have 4 default values for the user interface to be read from (and if altered, written to) a text file.
    What's the simplest way to go about this? I've read through many posts, and toyed around with readln and writeln functions, but nothing is working out. For some reason, I can't send any information to any file - let alone read it back in.
    Could somebody point me in the right direction? For simplicity sake let's say I have just one variable, "myVariable" - and I want to send it to and read it from c:\test.txt.
    Someday - this will all sink in. Right now, I'm reaching for Aspirin.

    Hi D Scott Chinn,
    Try something like this:
    var myFile = File.saveDialog ("Save file as:")
    if(myFile != undefined){
    var myString = "Write this string to a file."
    myFile.open("w");
    myFile.write(myString);
    myFile.close();
    Thanks,
    Ole

  • List Export Format for Prospects

    Hi,
    I am looking for a list export format for Prospects in Siebel Marketing. An example load format was provided and I am able to load prospects successfully but I need the list export format for Prospects to be able to launch. The OBI version used is 10.1.3.4.1 and while this provides example export formats for Accounts and Contacts it doesn't for Prospects. Does anyone know if there is such an export format for Prospects or would I need to create my own list format and subject are?
    Best regards,
    Pete
    Edited by: 855262 on Apr 28, 2011 8:06 AM

    Hi,
    I solved the problem myself. It was caused by the source (S_PRSP_CONTACT) for the logical table OLTP Prospects in the business model Marketing Contact List being inactive by default.

  • Error in Pre- Export methods for a request

    Hi All,
    I am getting an error while releasing a request, its giving
    "Error in Pre- Export methods for a request DM0k.....". Could you please tell me why and how can I rectify that?
    Thanks.
    NA

    Please go through as per the link
    [SAP Transport Request |http://www.sap-basis-abap.com/sapbs008.htm]
    thanks
    G. Lakshmipathi

  • Error in pre-export methods for request

    hi...
    while releasing the TR we are facing  this error  msg..." Error in pre-export methods for request" it is showing lock in fornt of the TR.neither be able to delete the TR ....
    do reply as soon as possible..

    Hi,
    I had the same error PU238.
    What I did was:
    Execute SE03 to unlock the object.
    Then execute the program 'RS_STREE_OBJECTS_TO_REQ_GET', not sure what it does.
    Afterwards, it worked perfectly.
    Hope that information helps you.
    Regards,

  • Export to Excel 2007 failed - Invalid export DLL or export format.

    Hi,
    Environment:
    OS: Windows XP (SP3)
    Crystal Reports : 12.1.0.892
    We have a problem for exporting few reports to Excel 2007 (Export to Excel 2003 works fine for those reports).
    Getting the bellow while trying to Export to Excel 2007.
    Crystal Report Windows Forms Viewer
    Error in File CDSFUN01 {99B42BC5-2FBB-4F75-A4F5-D7B5B7B6AE0B}.rpt:
    Invalid export DLL or export format.
    OK  
    Export Report
    Export failed.
    OK  
    Its the same case even if we try to Export blank report to Excel 2007 as well. Please help.

    I will make sure that I am on the latest patch ie SP4
    https://smpdl.sap-ag.de/~sapidp/012002523100008782452011E/cr2008sp4.exe
    You can find the rumtimes here:
    MSI:
    https://smpdl.sap-ag.de/~sapidp/012002523100008782532011E/cr2008sp4_redist.zip
    MSM:
    https://smpdl.sap-ag.de/~sapidp/012002523100008782522011E/cr2008sp4_mm.zip
    ClickOnce
    https://smpdl.sap-ag.de/~sapidp/012002523100008782442011E/cr2008sp4_clickonce.zip
    Recompile the app and then deploy.
    What is the .NET Framework used by the application?
    Method of deployment?
    OS where app is deployed, x86 or x64?
    Are you able to export the report from designer ie CR2008 Standalone?
    - Saurabh

  • Invalid export DLL or export format" with Crystal Reports 2008 to Excel xls

    We are experiencing the same issue as reported in the sticky thread. I answered in that thread, but thought that I woudl open a new thread to keep track of this issue.  I can give you the responses to your questions you have requested in that thread:
    Server Operating System - MS Windows Server 2003 R2 Enterprise Edition SP2
    Version of the .NET Framework - MS .NET Framework 3.5 SP1
    How did you deploy? - Installed CR 2008 SP1 runtime with msi package
    If you deployed with CRRuntime_12_0_mlb.msi - what was the date of the file and its size? CRRuntime_12_1_mlb.msi dated Sept. 16, 2008 12:55:00 PM, size: 56,717,824 bytes
    What is the file version of crpe32.dll on your server? You'll find this in the C:\Program Files\Business Objects\BusinessObjects Enterprise 12.0\win32_x86 directory - File was created 9/13/08 11:21AM, 9451KB File Version: 12.1.0.882
    How many libpng10.dll files are on your system? List all instances. - 1 instance is on the system located in C;\Program Files\Business Objects\Business Objects Enterprise 12.0\win32_x86 directory. It is dated 9/13/08 8:52:26AM 132KB version 1.0.30.1
    Any additional comments - We have tried to export to PDF and this works successfully. However, we can not export to xls or rft formats.
    CRXF_XLS.dll is 905KB 9/13/08 9:38AM Version 12.1.0.882
    CRXF_RTF.dll is 509KB 9/13/08 9:35AM Version 12.1.0.882
    We also have the CR XIR2 server runtime installed side by side on the server as we migrate from CR 2008 to CR XIR2 SP4 ( where this function does work currently).
    Please let me know if you need anything additional.
    Phil
    "Invalid export DLL or export format" with Crystal Reports 2008
    Posted: Sep 27, 2008 12:36 AM       E-mail this message      Reply 
    I've included this sticky because we are seeing many posts in this forum regarding the error Invalid export DLL or export format when exporting to Excel and RTF in .NET applications using the Crystal Reports 2008 .NET SDK.
    Issue
    Exporting a Crystal Report to Excel or RTF format
    .NET application using the Crystal Reports 2008 runtime (version 12.0)
    error Invalid export DLL or export format
    We've been doing some testing in-house and haven't reproduced this behavior. In order to figure this issue out we will need your help. If you are getting this error please reply to this post with the following information:
    Server Operating System
    Version of the .NET Framework
    How did you deploy?
    If you deployed with CRRuntime_12_0_mlb.msi - what was the date of the file and its size?
    What is the file version of crpe32.dll on your server? You'll find this in the C:\Program Files\Business Objects\BusinessObjects Enterprise 12.0\win32_x86 directory
    How many libpng10.dll files are on your system? List all instances.
    Any additional comments
    What We Know
    The error invalid export DLL or export format may occur when exporting to Excel and RTF formats in .NET applications utilizing the Crystal Reports 2008 runtime (v 12.0)
    Other export formats like Adobe PDF, Crystal Reports, CSV all export with no error
    Some customers have resolved this by adding C:\Program Files\Business Objects\BusinessObjects Enterprise 12.0\win32_x86 to their environment path variables
    This may have something to do with the file libpng10.dll. Both crxf_xls.dll and crxf_rtf.dll are dependent on it.
    Thanks in advance for your co-operation. We hope to figure out what is causing this issue soon.

    Hi,
    I am also having the same problem, except that I am not using Crystal Report 2008 runtime but the actual Crystal Report 2008 installation on Windows XP SP2 with VS Studio 2005 (VC++). MS .NET Framework 2.0.
    Cyrstal Report XIR2 was installed on the same machine but uninstalled before installing Crystal Report 2008.
    So only one instance of libpng10.dll and found in C:\Program Files\Business Objects\BusinessObjects Enterprise 12.0\win32_x86
    Crpe32.dll        3/1/2008 version 12.0.0.683
    Crxf_xls.dll       3/1/2008 version 12.0.0.683
    Crxf_rtf.dll         3/1/2008 version 12.0.0.683
    crdb_oracle.dll  3/1/2008 version 12.0.0.683
    libpng10.dll       3/1/2008 version 1.0.30.0             122880 bytes
    There is no problem for exporting to pdf, html, word, csv, Crystal Report. If I create a testing report without any data from database, the testing report can then be exported also to rtf and xls.
    Oracle 11.1.0.6 is the DB for the reports.
    Adding C:\Program Files\Business Objects\BusinessObjects Enterprise 12.0\win32_x86 to the path did not resolve my problem.
    Any idea to fix this issue?
    Thanks
    Kin H Chan

  • Custom TCode for Excel File Upload/Import - WebGUI Error

    We get an ABAP runtime error when uploading an excel file with a custom tcode using WebGUI.  It works ok with WinGUI.  Any ideas what could be causing that error?
    Runtime Errors         RAISE_EXCEPTION
    Date and Time          01/05/2011 17:27:16
    Short text
         Exception condition "JAVABEANNOTSUPPORTED" raised.
    What happened?
         The current ABAP/4 program encountered an unexpected
         situation.
    What can you do?
         Note down which actions and inputs caused the error.
         To process the problem further, contact you SAP system
         administrator.
         Using Transaction ST22 for ABAP Dump Analysis, you can look
         at and manage termination messages, and you can also
         keep them for a long time.
    Error analysis
         A RAISE statement in the program "C_OI_CONTAINER_CONTROL_CREATORCP" raised the
          exception
         condition "JAVABEANNOTSUPPORTED".
         Since the exception was not intercepted by a superior
         program, processing was terminated.

    You can use the below code. One more thing while running make sure there is no unsaved excel sheet open in your system.
    FORM sub_create_container .
    Create Instance control for container
      CALL METHOD c_oi_container_control_creator=>get_container_control
        IMPORTING
          control = iref_control
          error   = iref_error.
      IF iref_error->has_failed = c_check.
        CALL METHOD iref_error->raise_message
          EXPORTING
            type = 'E'.
      ENDIF.
    Create generic container linked to container in screen 100
      CREATE OBJECT oref_container
        EXPORTING
          container_name              = 'CONT'
        EXCEPTIONS
          cntl_error                  = 1
          cntl_system_error           = 2
          create_error                = 3
          lifetime_error              = 4
          lifetime_dynpro_dynpro_link = 5
          OTHERS                      = 6.
      IF sy-subrc <> 0.
        MESSAGE e000 WITH 'Error while creating container'(012).
      ENDIF.
    Establish connection to GUI Control
      CALL METHOD iref_control->init_control
        EXPORTING
          inplace_enabled      = c_check
          r3_application_name  = 'EXCEL CONTAINER'
          parent               = oref_container
        IMPORTING
          error                = iref_error
        EXCEPTIONS
          javabeannotsupported = 1
          OTHERS               = 2.
      IF iref_error->has_failed = c_check.
        CALL METHOD iref_error->raise_message
          EXPORTING
            type = 'E'.
      ENDIF.
    Create Document Proxy
      CALL METHOD iref_control->get_document_proxy
        EXPORTING
          document_type  = soi_doctype_excel_sheet
        IMPORTING
          document_proxy = iref_document
          error          = iref_error.
      IF iref_error->has_failed = c_check.
        CALL METHOD iref_error->raise_message
          EXPORTING
            type = 'E'.
      ENDIF.
    ENDFORM.                    " SUB_CREATE_CONTAINER
    FORM sub_create_document  USING    p_sheet TYPE i.
      DATA:  l_title   TYPE char40,
              l_char    TYPE char2,
              l_time    TYPE i,
              l_sheet   TYPE char12.
    Calculate the number of sheets to be created
      l_time = p_sheet - 1.
      CONCATENATE 'Assembly Table'(015) v_char INTO l_title
      SEPARATED BY space.
    Create document
      CALL METHOD iref_document->create_document                 " Open use Open_document method
        EXPORTING
          open_inplace   = c_check
          document_title = l_title
          no_flush       = c_check
        IMPORTING
          error          = iref_error.
    Open Spreadsheet interface
      CALL METHOD iref_document->get_spreadsheet_interface
        EXPORTING
          no_flush        = c_check
        IMPORTING
          sheet_interface = iref_spreadsheet
          error           = iref_error.
    Get number of sheets
      CALL METHOD iref_spreadsheet->get_sheets
        EXPORTING
          no_flush = c_check
        IMPORTING
          sheets   = i_sheets
          error    = iref_error.
    Reaname he sheet
      READ TABLE i_sheets INTO wa_sheets INDEX 1.
      l_char = p_sheet.
      CONCATENATE 'Sheet' l_char INTO l_sheet.
      CALL METHOD iref_spreadsheet->set_sheet_name
        EXPORTING
          newname  = l_sheet
          oldname  = wa_sheets-sheet_name
          no_flush = c_check
        IMPORTING
          error    = iref_error.
      REFRESH i_sheets.
      CLEAR: l_char,
             l_sheet.
    Add sheets
      DO l_time TIMES.
        l_char = sy-index.
        l_char = p_sheet - l_char.
        CONCATENATE 'Sheet' l_char INTO l_sheet.
        CALL METHOD iref_spreadsheet->add_sheet
          EXPORTING
            name     = l_sheet
            no_flush = c_check
          IMPORTING
            error    = iref_error.
      ENDDO.
    Get number of sheets
      CALL METHOD iref_spreadsheet->get_sheets
        EXPORTING
          no_flush = c_check
        IMPORTING
          sheets   = i_sheets
          error    = iref_error.
      SORT i_sheets BY sheet_name DESCENDING.
    ENDFORM.                    " SUB_CREATE_DOCUMENT
    FORM sub_save_document .
      DATA: l_changed     TYPE int4.
    Save the document
      CALL METHOD iref_document->save_as
        EXPORTING
          file_name = p_file
          no_flush  = c_check
        IMPORTING
          error     = iref_error.
    Close the document
      CALL METHOD iref_document->close_document
        EXPORTING
          do_save     = c_check
          no_flush    = ''
        IMPORTING
          has_changed = l_changed
          error       = iref_error.
    ENDFORM.                    " SUB_SAVE_DOCUMENT
    Thanks
    Subhankar

  • Looking for example to export data from a DynPro table to Excel file

    Hello,
    I have a certain content in a table.
    I would like to export this content to Excel file and let the user save it on his PC. I tried to use the Office Controller but with no success.
    Have someone already made something like this and can show me an example?

    Hi
    I already explained this in another post. Anyway i will cut and paste the same for you.Here you go.Sample way to create a Excel file and then download it to a local pc using a FileUI Download element.
    We are developing a generic component for the same requirement which will download data to a excel from any table.
    Anyway here is something which will give you some kind of idea as to how you can write the data from WebDynpro to a excel file.
    For running this application
    Ensure that the requisite JAR files are set for the Excel API's. See the blog link below.
    Steps :
    All your files in the machine running the WAS will be created in the default location
    Alias : webdynpro/resources
    Path : <Drive>:/usr/sap/J2E/JC00/j2ee/cluster/server0/temp/webdynpro/web
    You can open your Visual Administrator and go to HTTP provider service and then create your own Alias. say
    Alias : myAlias
    Path : <Drive>:/mydirectory/myfiles
    Once this is done restart your WebAS.
    The code explained will perform the following.
    There is a button UI element and a Download UI element. On click of the Action associated with the button ui element
    The code below will create a excel file in the location mentioned.
    On click of the download UI element you can view the excel file that was created.
    Now create a New project in your NWDS
    Follow the blog for importing the necessary jar files for Excel
    /people/perumal.kanthan/blog/2005/03/21/reading-excel-data-from-java-using-hssf-api
    Once that is done you can create say a button in your Webdynpro and associate it with a action.
    Then you can write some code like the one below.
    //Declare this in the end between the Begin others block.
      private FileOutputStream out = null;
      private HSSFWorkbook workBook = null;
      private HSSFSheet hsSheet = null;
      private HSSFRow row = null;
      private HSSFCell cell = null;
      private HSSFCellStyle cs = null;
      private HSSFCellStyle cs1 = null;
      private HSSFCellStyle cs2 = null;
      private HSSFDataFormat dataFormat = null;
      private HSSFFont f = null;
      private HSSFFont f1 = null;
    //Code to create the Excel.
      public void onActionExportToExcel(com.sap.tc.webdynpro.progmodel.api.IWDCustomEvent wdEvent )
        //@@begin onActionExportToExcel(ServerEvent)
        try
          out = new FileOutputStream("C:/mydirectory/myfiles/testexcel.xls");
          workBook = new HSSFWorkbook();
          hsSheet = workBook.createSheet("My Sheet");
          cs = workBook.createCellStyle();
          cs1 = workBook.createCellStyle();
          cs2 = workBook.createCellStyle();
          dataFormat = workBook.createDataFormat();
          f =  workBook.createFont();
          f1 = workBook.createFont();
           f.setFontHeightInPoints((short) 12);
    //          make it blue
           f.setColor( (short)HSSFFont.COLOR_NORMAL );
    //           make it bold
    //          arial is the default font
           f.setBoldweight(HSSFFont.BOLDWEIGHT_BOLD);
    //          set font 2 to 10 point type
           f1.setFontHeightInPoints((short) 10);
    //          make it red
           f1.setColor( (short)HSSFFont.COLOR_RED );
    //          make it bold
           f1.setBoldweight(HSSFFont.BOLDWEIGHT_BOLD);
          f1.setStrikeout(true);
          cs.setFont(f);
          cs.setDataFormat(dataFormat.getFormat("#,##0.0"));
    //       set a thick border
         cs2.setBorderBottom(cs2.BORDER_THICK);
    //       fill w fg fill color
         cs2.setFillPattern((short) HSSFCellStyle.SOLID_FOREGROUND);
        cs2.setFillBackgroundColor((short)HSSFCellStyle.SOLID_FOREGROUND);
    //       set the cell format to text see HSSFDataFormat for a full list
         cs2.setDataFormat(HSSFDataFormat.getBuiltinFormat("text"));
         cs2.setFont(f1);
         cs2.setLocked(true);
         cs2.setWrapText(true);
         row = hsSheet.createRow(0);
         hsSheet.createFreezePane(0,1,1,1);
        for(int i=1; i<10;i++)
           cell = row.createCell((short)i);
          cell.setCellValue("Excel Column "+i);
          cell.setCellStyle(cs2);
         workBook.write(out);
         out.close();
    //Read the file that was created.
         FileInputStream fin = new FileInputStream("C:/mydirectory/myfiles/testexcel.xls");
         byte b[] = new byte[fin.available()];
         fin.read(b,0,b.length);
         fin.close();
         wdContext.currentContextElement().setDataContent(b);
        catch(Exception e)
          wdComponentAPI.getComponent().getMessageManager().reportException("Exception while reading file "+e,true);  
        //@@end
    You can now add a Download UI Element to the layout.
    Create a Context Attribute say "dataContent" and this should be of Type Binary.
    The Data property of the File UI download element should be mapped to dataContent.
    In the init method write code like
    This is done for the download element.
         IWDAttributeInfo attInfo = wdContext.getNodeInfo().getAttribute("dataContent");   
         IWDModifiableBinaryType binaryType = (IWDModifiableBinaryType) attInfo.getModifiableSimpleType();
    //In addition the FileDownload UI element needs for defined resource types  
         binaryType.setFileName("testexcel.xls");
         binaryType.setMimeType(WDWebResourceType.XLS);
    Hope that helps you. Anyway its a sample and it should be helpful for you to see how you can modify it and of course maintain some standards in coding unlike the test sample given above :).
    Let me know if you require further clarifications
    regards
    ravi

  • Error accessing method in 3rd party dll

    already asked for help a few weeks ago but no one answered and i still wasn't able to figure out what the problem...
    i have a 3rd party dll and im trying to access some methods (USING JNI)- i have no problem accessing methods with no parameters and they work fine but a method with parameters just wwont work.
    i guess that its something with my syntax - probably incorrect data type when converting from java type to native type...
    i dont have any previous expirience with c so help would be appriciated...
    heres my java code:
    package pavel2.javay;
    class Test {
        native String VersionGet();
        native String loadDll();
        native String LogInMT4(int account,String  pass,String server,String a,String v,String c,String d);
        static {
            System.loadLibrary("pavel2");
        public static void main(String args[]) {
            Test t = new Test();
            System.out.println(t.loadDll());
            System.out.println(t.LogInMT4(230622,"qd1bvvs","Orion-DEMO","","","",""));
    }and the dll wrapper:
    #include <windows.h>
    #include <C:\\Program Files\\Java\\jdk1.6.0_10\\include\\jni.h>
    #include <C:\\Program Files\\Java\\jdk1.6.0_10\\include\\win32\\jni_md.h>
    typedef char*   (*LogIn_MT4)( const int login, const char *password, const char *server, const char *proxyserver,
                   const char *proxytype, const char *proxylogin, const char *proxypassword);
    HINSTANCE hOle2Dll;
    JNIEXPORT jstring JNICALL Java_pavel2_javay_Test_loadDll(JNIEnv * env, jobject jobj){
         hOle2Dll = LoadLibrary(TEXT("D:\\pavel2\\tzmt4api.dll"));
         return  (*env)->NewStringUTF(env, "tzmt4api.dll loaded!!");
         /*if (OleInitialize(NULL) == S_OK)
              if ( hOle2Dll >= 32 )
                   //FreeLibrary ( hOle2Dll ) ;
    JNIEXPORT jstring JNICALL Java_pavel2_javay_Test_LogInMT4(JNIEnv * env, jobject jobj,jint login, jstring password, jstring server,jstring proxyserver,jstring proxytype,jstring proxylogin,jstring proxypassword){
                   LogIn_MT4 fnc ;
                   fnc = (LogIn_MT4)GetProcAddress ( hOle2Dll , "LogIn_MT4" ) ;
                   if ( fnc == NULL )
                        MessageBox(NULL, TEXT("Error loading Method"), TEXT("Error"), MB_OK);
                   else
                   const char *pass = (*env)->GetStringUTFChars(env, password, NULL);
                   const char *ser = (*env)->GetStringUTFChars(env, server, NULL);
                   const char *proxyserv = (*env)->GetStringUTFChars(env, proxyserver, NULL);
                   const char *proxyt = (*env)->GetStringUTFChars(env, proxytype, NULL);
                   const char *proxylog = (*env)->GetStringUTFChars(env, proxylogin, NULL);
                   const char *proxypass = (*env)->GetStringUTFChars(env, proxypassword, NULL);
                   int a=fnc(login, pass, ser, proxyserv,proxyt,proxylog,proxypass);
                   (*env)->ReleaseStringUTFChars(env, password, pass);
                   (*env)->ReleaseStringUTFChars(env, server, ser);
                   (*env)->ReleaseStringUTFChars(env, proxyserver, proxyserv);
                   (*env)->ReleaseStringUTFChars(env, proxytype, proxyt);
                   (*env)->ReleaseStringUTFChars(env, proxylogin, proxylog);
                   (*env)->ReleaseStringUTFChars(env, proxypassword, proxypass);
                   //return  (*env)->NewStringUTF(env, empty);
                   return  (*env)->NewStringUTF(env, "logged");
                             //int c = fnc(login, *password, *server, "", "", "", "");
    BOOL APIENTRY DllMain( HMODULE hModule,
                           DWORD  ul_reason_for_call,
                           LPVOID lpReserved
         switch (ul_reason_for_call)
         case DLL_PROCESS_ATTACH:
         case DLL_THREAD_ATTACH:
         case DLL_THREAD_DETACH:
         case DLL_PROCESS_DETACH:
              //todo: unregister class here
              break;
         return TRUE;
    }this is the output:
    tzmt4api.dll loaded!!
    # An unexpected error has been detected by Java Runtime Environment:
    # EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0xcccccccc, pid=3792, tid=3824
    # Java VM: Java HotSpot(TM) Client VM (11.0-b15 mixed mode, sharing windows-x86)
    # Problematic frame:
    # C 0xcccccccc
    # An error report file with more information is saved as:
    # C:\Program Files\TradeZone\TZMT4APInew\Work\hs_err_pid3792.log
    # If you would like to submit a bug report, please visit:
    # http://java.sun.com/webapps/bugreport/crash.jsp
    # The crash happened outside the Java Virtual Machine in native code.
    # See problematic frame for where to report the bug.
    Process finished with exit code 1
    p.s - it looks like the login method works but when returning to java the VM crashes
    can anyone help me?

    jschell - tried this already and got the same ..
    ejp - i cant do this bucause i dont have a .lib and this proccess can run only on windows unfortunately...
    my problem is that i dont know the how to create the correct type for the method:
    this is the signature:
    typedef int  (*LogIn_MT4)( const int login, const char *password, const char *server, const char *proxyserver,
                   const char *proxytype, const char *proxylogin, const char *proxypassword);how do i create in c this var types?
    int a=fnc(1531, "asas", "asd", "","","","");how do i create
    const char *xxx type? and its okay for the int just to write a number or i also need to declare it?                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

  • Exporting a List to Excel to use for Excel Services WebPart (not working)

    Hey everyone, here's the scenario. I'm trying to export a list to excel and save it to a library. All the connections are saved. Now. I want that excel file to render as a web part. When I make a change on the list and try to refresh the data connection
    I get the error below. Please help
    AJ MCTS: SP 2010 Configuration MCSA: Windows 7 If you find this post useful kindly please mark it as an answer :) TY

    Hi,
    I did a test as the followings:
    Create a list, and add some items into it.
    Export the list into a Excel file, then upload the excel file to a library.
    When I opened the file via Excel service, I saw the a yellow warning about unsupported features.
    Then I created a wiki page, and add Excel Web Access web part and connect the web part to the excel file.
    When I refresh all data conections, nothing happened.
    From the article:
    https://msdn.microsoft.com/en-us/library/ms496823.aspx (they are similar with SharePoint 2013)
    SharePoint lists are not supported for Excel service. So, it may cause this issue.
    I suggest you click "Open in Excel" to open the file in Excel application, then refresh the data connection, and save back to SharePoint. Then after you refresh the page, the data of the Excel Web Access web part will refresh.
    Thanks,
    Wendy
    TechNet Community Support
    Please remember to mark the replies as answers if they help, and unmark the answers if they provide no help. If you have feedback for TechNet Support, contact
    [email protected]

Maybe you are looking for