Apache OpenOffice (AOO) Bugzilla – Full Text Issue Listing |
Summary: | Date field displays incorrect value as number text in Base report | ||||||||
---|---|---|---|---|---|---|---|---|---|
Product: | Base | Reporter: | fanyuzhen | ||||||
Component: | code | Assignee: | hanya <hanya.runo> | ||||||
Status: | CLOSED FIXED | QA Contact: | hdu <hdu> | ||||||
Severity: | Critical | ||||||||
Priority: | P2 | CC: | hanya.runo, hdu, issues, jsc, kschenk, oooforum, rainerbielefeld_ooo_qa | ||||||
Version: | 4.0.0-dev | Flags: | jsc:
4.0.0_release_blocker+
|
||||||
Target Milestone: | 4.0.0 | ||||||||
Hardware: | All | ||||||||
OS: | All | ||||||||
Issue Type: | DEFECT | Latest Confirmation in: | --- | ||||||
Developer Difficulty: | --- | ||||||||
Attachments: |
|
Description
fanyuzhen
2013-06-27 07:57:21 UTC
Maybe linked with https://issues.apache.org/ooo/show_bug.cgi?id=121492 *** Issue 122602 has been marked as a duplicate of this issue. *** It seems not only for Date but also for other kind of data types. As a workaround, - open the report document to edit. - Select a column and choose Table - Number Format in the main menu and apply format. - Save the document. I got the following error during the new report creation using the report wizard. Each cells of the created table on the report document takes the same number format with the bound column in NumberFormatter.setNumberFormat method. Before to set NumberFormat property to the cell, FormatsSupplier property is tried to set. But current cell in the table on the text document does not have FormatsSupplier property. The following error raised and NumberFormat is not set. com.sun.star.beans.UnknownPropertyException: FormatsSupplier at com.sun.star.bridges.jni_uno.JNI_proxy.dispatch_call(Native Method) at com.sun.star.bridges.jni_uno.JNI_proxy.invoke(JNI_proxy.java:171) at sun.proxy.$Proxy6.setPropertyValue(Unknown Source) at com.sun.star.wizards.common.NumberFormatter.setNumberFormat(NumberFormatter.java:200) at com.sun.star.wizards.report.DBColumn.initializeNumberFormat(DBColumn.java:240) at com.sun.star.wizards.report.ReportTextDocument.insertColumnstoRecordTable(ReportTextDocument.java:456) at com.sun.star.wizards.report.ReportTextDocument.setupRecordSection(ReportTextDocument.java:340) at com.sun.star.wizards.report.ReportTextImplementation.layout_setupRecordSection(ReportTextImplementation.java:549) at com.sun.star.wizards.report.ReportLayouter.initialize(ReportLayouter.java:225) at com.sun.star.wizards.report.ReportWizard.leaveStep(ReportWizard.java:236) at com.sun.star.wizards.ui.WizardDialog.switchToStep(WizardDialog.java:359) at com.sun.star.wizards.ui.WizardDialog.switchToStep(WizardDialog.java:354) at com.sun.star.wizards.report.ReportWizard.finishWizard(ReportWizard.java:358) at com.sun.star.wizards.ui.WizardDialog.finishWizard_1(WizardDialog.java:692) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:616) at com.sun.star.wizards.ui.event.MethodInvocation.invoke(MethodInvocation.java:90) at com.sun.star.wizards.ui.event.AbstractListener.invoke(AbstractListener.java:86) at com.sun.star.wizards.ui.event.CommonListener.actionPerformed(CommonListener.java:45) at com.sun.star.bridges.jni_uno.JNI_proxy.dispatch_call(Native Method) at com.sun.star.bridges.jni_uno.JNI_proxy.invoke(JNI_proxy.java:171) at sun.proxy.$Proxy110.execute(Unknown Source) at com.sun.star.wizards.ui.UnoDialog.executeDialog(UnoDialog.java:730) at com.sun.star.wizards.report.ReportWizard.startReportWizard(ReportWizard.java:497) at com.sun.star.wizards.report.CallReportWizard$ReportWizardImplementation.trigger(CallReportWizard.java:120) Created attachment 80925 [details]
Proposed patch to fix the problem.
When setNumberFormat method is called from DBColumn::initializeNumberFormat method,
the number formatter is the document's one.
And the passed arguments are from the database column.
Before the format key is set to the table cell, the format key from the
column is used to generate new key on the number format supplier.
Therefore to set FormatsSupplier property of the cell is not required
(I mean, document's one is used).
The same setNumberFormat method is called from other wizard, so the line
should not be removed, check the property existence before to set it.
Created attachment 80926 [details]
Test case containing a table with number formatted columns
To verify:
- Open the attached NumberFormatTest.odb file.
- Click Reports in Database and then click Use Wizard to Create Report...
- Push >> button to add all fields to the report.
- Push Finish button.
The result should be:
ID DATE VALUE
0 01/01/2000 100.0200
1 02/02/2001 200.0001
2 02/02/2002 300.1000
...
for the following number formats: DATE: YYYY/MM/DD, VALUE: 0.0000
Confirmed as well. Thanks for the patch. We'll check it out. Confirming the original problem too and confirming that Hanya's patch works great (as always :-) ). Thanks for the patch! Suggesting to include it in the imminent release: The patch fixes the problem and cannot have any impact on other areas. grant showstopper flag, patch available "hdu" committed SVN revision 1501137 into trunk: #i122603# fix database wizard's use of the Numberformatter Applied Hanya's patch and updating the status to FIXED. Changed "Assigned to" to patch submitter to ease reliable queries. |