Issue 20198 - Can't make report from a nativ query.
Summary: Can't make report from a nativ query.
Status: CLOSED FIXED
Alias: None
Product: Base
Classification: Application
Component: code (show other issues)
Version: OOo 1.1 RC4
Hardware: Other Linux, all
: P3 Trivial (vote)
Target Milestone: OOo 2.0
Assignee: marc.neumann
QA Contact: issues@dba
URL:
Keywords:
Depends on: 20601
Blocks: 20039
  Show dependency tree
 
Reported: 2003-09-26 15:53 UTC by godofpain
Modified: 2006-05-31 14:29 UTC (History)
4 users (show)

See Also:
Issue Type: DEFECT
Latest Confirmation in: ---
Developer Difficulty: ---


Attachments
basic script for this issue (602 bytes, text/plain)
2003-09-29 08:55 UTC, marc.neumann
no flags Details

Note You need to log in before you can comment on or make changes to this issue.
Description godofpain 2003-09-26 15:53:51 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)
Comment 1 marc.neumann 2003-09-29 08:55:03 UTC
Created attachment 9778 [details]
basic script for this issue
Comment 2 marc.neumann 2003-09-29 09:01:01 UTC
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
Comment 3 godofpain 2003-09-29 15:50:12 UTC
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. 

Comment 4 marc.neumann 2003-10-02 12:05:00 UTC
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.
Comment 5 marc.neumann 2003-10-02 12:32:11 UTC
.
Comment 6 godofpain 2003-10-02 16:01:37 UTC
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.
Comment 7 marc.neumann 2003-10-06 08:12:45 UTC
reopen
Comment 8 marc.neumann 2003-10-06 08:14:03 UTC
this issue is not fixed, so I reopen it.
Comment 9 hans_werner67 2004-02-02 12:33:03 UTC
change subcomponent to 'none'
Comment 10 berend.cornelius 2004-12-21 13:49:22 UTC
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
Comment 11 berend.cornelius 2005-01-20 09:53:47 UTC
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?


Comment 12 berend.cornelius 2005-01-20 09:55:04 UTC
.
Comment 13 christian.jansen 2005-01-20 10:28:17 UTC
CJ->BC: Please add a hint/solution to the warning which gives users an idea how
to solve the problem. This is better style.
Comment 14 berend.cornelius 2005-01-20 11:09:59 UTC
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:
Comment 15 berend.cornelius 2005-01-21 08:57:27 UTC
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";
};



Comment 16 berend.cornelius 2005-01-24 10:36:08 UTC
.
Comment 17 e.matthis 2005-01-24 12:06:07 UTC
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.";
};
Comment 18 berend.cornelius 2005-01-28 15:11:40 UTC
Fixed in dbwizard3
Comment 19 berend.cornelius 2005-01-28 15:13:29 UTC
.
Comment 20 berend.cornelius 2005-01-28 15:15:20 UTC
.
Comment 21 berend.cornelius 2005-01-28 15:16:37 UTC
.
Comment 22 marc.neumann 2005-02-14 14:34:11 UTC
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
Comment 23 hwoarang 2005-03-07 11:15:30 UTC
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.
Comment 24 Frank Schönheit 2005-03-07 13:20:35 UTC
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.
Comment 25 marc.neumann 2005-03-14 15:43:37 UTC
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
Comment 26 elizabeth.matthis 2005-03-18 15:56:01 UTC
removing "em" from cc as that is an invlaid user (I am "liz")