Format exported data (Office Integration Pack)

Nov 23, 2012 at 9:40 AM

Can I format exported data somehow? I exported for example columns "adress", "prize", "date" from my Lightswitch apliaction (VS 2012). All columns are exported as text format. Can I change format data as it is being exported or fix aplication format of fileds (string, decimal, date) ? I need to have number format in Excel because of making analysis, additional calculation etc.

Thank you

Radka

Nov 23, 2012 at 10:42 AM

I do my exports to Excel via code in the server part

I use this library  http://epplus.codeplex.com/

It is not compatible with Silverlight, but sending a command to the server part of your application, you can have the server export this to a real excel file, and send the data back to the client.

For sending commands, you have to use the command table pattern

see:  http://blog.pragmaswitch.com/?p=332

 

Aug 22, 2014 at 9:37 AM
Any otherway to do it directlly in Lightswitch, I have this code:
     partial void New_Excel_Export_Execute()
        {
     
            List<string> columns = new List<string>();
            columns.Add("Customer_No_") ;
            columns.Add("Hotel_Name");
            columns.Add("Post_Code");
            columns.Add("Hotel_City");
            columns.Add("Country");
            columns.Add("Hotel_Status");
            columns.Add("Contract_Status_Code");
            columns.Add("Chain_Code");
            columns.Add("Brand_Name");
            columns.Add("Brand_Code"); 
            columns.Add("Brand_Name");
            columns.Add("Electronic_Payment_Method");
            columns.Add("Reason_Code");
            columns.Add("Inkasso");
            columns.Add("Balance__LCY_");
            OfficeIntegration.Excel.Export(this.BalanceGreaterZero, columns);

         }