Apache OpenOffice (AOO) Bugzilla – Issue 20198
Can't make report from a nativ query.
Last modified: 2006-05-31 14:29:06 UTC
I cannot make a report or a form from a query on my ODBC database. I can make a report and form from a table but when I select a simple query to get data from the table the dialog to select fields does not show any fields to add to the report or form. The default Bibliography work great, no problems. I also connected to a simple spread sheet and it worked fine also. The ODBC is the only DB source that does not work. I am running Java j2sdk1.4.1_02 and I get this message on the command line when the error happens. java.lang.NullPointerException at com.sun.star.wizards.report.ReportWizard.addFieldNamestoListBox(ReportWizard.java:417) at com.sun.star.wizards.report.ReportWizard.fillUpFieldsListbox(ReportWizard.java:466) at com.sun.star.wizards.report.ReportWizard.fillupCommandListBox(ReportWizard.java:406) at com.sun.star.wizards.report.ReportWizard.fillFirstStep(ReportWizard.java:1638) at com.sun.star.wizards.report.ReportWizard.startReportWizard(ReportWizard.java:1702) at com.sun.star.wizards.report.CallReportWizard$ReportWizardImplementation.initialize(CallReportWizard.java:226) at com.sun.star.comp.loader.FactoryHelper$Factory.createInstanceWithArgumentsAndContext(FactoryHelper.java:340) java.lang.NullPointerException at com.sun.star.wizards.report.ReportWizard.addFieldNamestoListBox(ReportWizard.java:417) at com.sun.star.wizards.report.ReportWizard.fillUpFieldsListbox(ReportWizard.java:466) at com.sun.star.wizards.report.ReportWizard.access$100(ReportWizard.java:156) at com.sun.star.wizards.report.ReportWizard$ItemListenerImpl.itemStateChanged(ReportWizard.java:566) 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:204) at $Proxy69.execute(Unknown Source) at com.sun.star.wizards.common.UNODialogs.executeDialog(UNODialogs.java:569) at com.sun.star.wizards.report.ReportWizard.startReportWizard(ReportWizard.java:1726) at com.sun.star.wizards.report.CallReportWizard$ReportWizardImplementation.initialize(CallReportWizard.java:226) at com.sun.star.comp.loader.FactoryHelper$Factory.createInstanceWithArgumentsAndContext(FactoryHelper.java:340)
Created attachment 9778 [details] basic script for this issue
Hi Roy, The problem seems that your ODBC datasource doesn't return the number of columns in a query. I have attached a basic example to test this. Please go to TOOLS/MACRO/MACRO and select soffice/Standard/Module1 on the left hand side, then click EDIT. Paste the content of the attached basic file into the edit window. Then you have to correct the name of the datasource and the query name. Then execute the basic example. There should be message box at the end which show the number of columns. Which number is displayed? Bye Marc
The script you posted returns 2. That is the correct number. My simple query says "SELECT name,title FROM listtable WHERE theindex = '3'". OO reformats the query but it still does the same thing. As you can see 2 is the correct number and so at that point it does know the number of columns.
set target, canhe summary, confirm and send to the right developer. MSC -> BC: The problem is that the query the user use is saved in nativ mode. So the API doesn't return the columns. The part you can fix is that a usefull error message pop up when no columns can be found.
.
Yes a pop-up dialog to inform the user about native mode would be very helpful here. It works now. Thanks for all the help.
reopen
this issue is not fixed, so I reopen it.
change subcomponent to 'none'
BC: Can't reproduce the bug in a m65 on a MySQL ODBC datasource, but I will ask MSC after Christmas, if he can show me
I could indeed reproduce the bug with a native query and found out that a Nullpointer exception was thrown: After a discussion with OJ we agreed that such an exception should generally be reflected in an error Messagebox as it could well be that such an error also occurs with other queries or tables. Accordingly I find that the error message should be kept as general as possible. Therefor I propose the following error message: String RID_DB_TABLE_WIZARD_START + 50 { Text [ de ] = "Die Feldnamen konnten nicht ermittelt werden"; Text [ en-US] = "The fieldnames could not be retrieved"; }; BC->CJ,EM: Your comment?
CJ->BC: Please add a hint/solution to the warning which gives users an idea how to solve the problem. This is better style.
BC: After another discussion with OJ we agreed on the following errormessage. String RID_DB_TABLE_WIZARD_START + 50 { Text [ de ] = "Die Felder von %COMMAND konnten nicht ermittelt werden"; Text [ en-US] = "The fieldnames of %COMMAND could not be retrieved"; }; To give more hints than that could possibly lead the user into the wrong direction BC->EM->Your turn:
BC: The variables in the strings have to be surrounded by quotes of course: String RID_DB_TABLE_WIZARD_START + 51 { Text [ de ] = "Die Felder von '%COMMAND' konnten nicht ermittelt werden"; Text [ en-US] = "The fieldnames of '%COMMAND' could not be retrieved"; };
Liz->BC: pls use these strgs: String RID_DB_TABLE_WIZARD_START + 51 { Text [ de ] = "Die Felder von '%NAME' konnten nicht ermittelt werden."; Text [ en-US] = "The field names from '%NAME' could not be retrieved."; };
Fixed in dbwizard3
hi, verified in cws dbwizard3. You can't still not create a report with a native query, but now you get at least an error messages. Bye Marc
Hi. Reading all comments I still in doubt: this RESOLVED/FIXED means that OOo will *never* accept native query to make a report? Or the popup error is just a workaround? Thank you.
yes. Somewhat unfortunate that this issue here developed this way, perhaps a new issue requesting the enhancement "reports for native queries" would be a good idea.
Hi, fixed in current developer build -> close. The current developer build can be found at http://download.openoffice.org/680/index.html Feel free to reopen if this issue is not fixed in the developer build. Bye Marc
removing "em" from cc as that is an invlaid user (I am "liz")