Data type issues on ActiveReport v9

Posted by: daniel.leong on 2 March 2021, 3:06 pm EST

  • Posted 2 March 2021, 3:06 pm EST

    Hi,

    We are using ActiveReport v9 and having trouble using with set data type and alignment of reports.

    When a report is downloaded, the cell datatype and alignment is different than what is assigned. It seems that the export is recognized as a Text format for fields instead of the assigned format.

    Note: We have a 9X9 matrix with all the datatypes that is supported by MS Excel. Please find attached spreadsheet for reference.

    Technically the system detects the column datatype and sets Textbox property (OutputFormat and Alignment) as per column datatype, while detail_Format method called at row level, system override the datatype and alignment for the control.

    On the attached file check yellow highlighted cells and their data type.

    Any help would be appreciated.

  • Posted 2 March 2021, 3:29 pm EST

  • Posted 2 March 2021, 9:55 pm EST

    Hello,

    You can set the ‘OutputFormat’ property of the TextBox manually. If you are still facing any issue, please share the report with us so that I can look into this.

    Thanks,

    Mohit

  • Posted 4 March 2021, 3:01 pm EST

    Hey Mohit,

    Thanks for the quick reply. We are already setting ‘OutputFormat’ property of the TextBox manually based on cell data type. Once report is exported, its recognised as Text only instead of specified data type.

    Appreciate if you can check attached zip file with name ‘Demo_Websheet.zip’ for reference of the report.

    Cheers

  • Posted 9 March 2021, 2:37 am EST

    Hello,

    Sorry for the delay!

    Actually, excel sheet is confusing. 9*9 table what does it mean. Can you share the sheet where you put the value, expected output and current output.

    This will be very helpful for us.

    Thanks,

    Mohit

  • Posted 9 March 2021, 6:16 pm EST

    Hey Mohit,

    Please find attached zip file. Added current output and expected output.

    Please check alignment and format cell for yellow highlighted field and compare. Here you can find difference in alignment as well as data type of field.

    Cheers

  • Posted 9 March 2021, 6:17 pm EST

  • Posted 11 March 2021, 5:52 pm EST

    Hello,

    I am really sorry that still I don’t understood your problem. Like in your demo excel file, you have Table 9*9 where you don’t get the expected output when column is Currency and Row is Date.

    Request to please confirm that which format(Currency or Date) you have set in the OutputFormat of the TextBox in the report as you set only the single format.

    Please share the report instead of the excel file which demonstrate the issue so that I can replicate the issue at my end. Also, I have checked after setting the Date format, and it exports with correct format.

    I am very sorry for the inconvenience caused to you.

    Thanks,

    Mohit

  • Posted 17 March 2021, 11:14 am EST

    Hi Mohit,

    Sorry. The report is created dynamically, so I cannot see how we can send it to you?

    For currency, we set currency. For dates we set dates.

    Are you using ActiveReports v9 to test the Output formats?

    I believe dates format correctly when there are non-text values only in the row before/after the date values. Can you confirm that date values format correct even after adding text values in the row before and after date values?

    Thanks so much for your patience on helping us through this!

    Regards

    Daniel

  • Posted 17 March 2021, 3:53 pm EST

    Hello,

    You need to change the Text value to DateTime Format in the Format event of the Detail Section as follow to get the correct result:

    public void Detail_Format()
    {
    	this.TextBox1.Value = DateTime.Parse(this.TextBox1.Text);	
    }
    
    

    Thanks,

    Mohit

  • Posted 17 March 2021, 7:54 pm EST

    Hi Mohit,

    Excellent! Great, will give this a try. Do you have any suggestions for currency or percentage or integer values?

  • Posted 17 March 2021, 9:47 pm EST

    Hello,

    For currency or percentage or integer values, you can use the following code:

    public void Detail_Format()

    {

    this.TextBox1.Value = int.Parse(this.TextBox1.Text);

    }

    Thanks,

    Mohit

  • Posted 18 March 2021, 11:33 am EST

    Thanks Mohit! Will try that out and post results.

Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels