Jump to content
We've recently updated our Privacy Statement, available here ×

Newbie User - ODBC connection help - it shouldn't be that hard!


maiskip

Recommended Posts

Hi, I have just downloaded iReports and I have fallen at the first hurdle as I can't get my database connection to work properly.   When I click 'Test' it tells me that the connection has been succesful.  I can also see the tables in my database in the next screen but I can't select any of them or anything from them.  

I want to connect to our main system database which I normally connect via SQL, Access or Excel, etc.  I have a DSN set up which uses a Visual FoxPro Database driver.   Could someone give me an example of how to set up an ODBC connection through Jasper reports. (I assume I should be using the "Database JDBC connection" but I really could do with some syntax help from this point.

I also can't find where to edit a connection once I have made it.

I managed to create a report by pointing iReport at a csv but I cannot get it to talk to my visual foxpro database.

Any advice very greatfully received please.

 

 



Post Edited by maiskip at 06/29/2011 12:19
Link to comment
Share on other sites

  • 4 weeks later...
  • Replies 5
  • Created
  • Last Reply

Top Posters In This Topic

Hi again, I have been on holiday and come back and still have not managed to find my way around this problem  - getting a bit fed up with it now.

If no-one has any ideas for a fix, could someone suggest another reporting tool with a more simple ODBC connect method please. I already have an Access DB but it is not cost friendly for us. 

 

Link to comment
Share on other sites

Have you tried anything like the following:

 

strConnection = _T("Driver={Microsoft Visual Foxpro Driver};UID=;"

"SourceType=DBF;SourceDB=C:\\DatabasePath\\MyDatabase.dbc;Exclusive=No"

 

also, check out the tutorial video in the following link:

 

http://jasperforge.org/website/ireportwebsite/IR%20Website/tutorials/podcast_1/podcast_1.html?header=project&target=ireport

Link to comment
Share on other sites

I tried that thanks and watched the Podcast and I seem to be doing everything right but I still don't get any data back.  My test connection is successful though.  If I use the query wizard it does nothing.  However if I type in a simple SQL statement like "Select * from Supplier" directly in the query window I then get a list of fields from my supplier table?! Weird.  I can then select the fields I want and it says congratulations, you've created you report.  Unfortunately, there is nothing in it.

I have also tried getting the Sample database working but when I do the Help- Samples - Run Sample Database bit I just get an error message there too:  "An error occurred whle starting up the sample database. Database not running. Check the log from the ......."    I viewed the log which means precisely nothing to me.

Thanks for the reply.

Link to comment
Share on other sites

 ah - ok, once you're connected and have the sql run, you actually have to pull the fields onto the page. If you go to the Window menu, select Report Inspector, you will see "Fields" listed - expand that and drag whatever fields you need over onto the page. 

Link to comment
Share on other sites

  • 2 weeks later...

Thanks for that.  I fianlly got around to giving it another go and I did actually think I was getting somewhere at one point but it was not to be.  I have fields on my report but there is still no data despite the software having congratulated me on creating many reports.  I have no problem with Crystal, Cognos, Access, Excel and others but this one just isn't having any of it.  If I have problems at this stage then I don't really hold out much hope for my users so I think I am going to give this one a miss.

Thanks anyway.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...