hog Posted April 11, 2003 Posted April 11, 2003 I have created a report based on a dataset in order to get the underlying report to up and running. The report then uses a dynamic dataset at runtime to populate its fields based on user selection. I now need to add other fields but I see that the fields I can choose from in design mode are restricted to those in the original dataset. If I update the report to point to a modified version of the original dataset I loose all formatting on the report. Is there a way to add fields at will without buggering the whle report? This is very staright forward in Access report writer but cannot work out how to do it in Crystal reports? Quote My website
hog Posted April 11, 2003 Author Posted April 11, 2003 Sorted: Field Explorer -> Database Fields -> Right Click table -> Verify Database Quote My website
Chong Posted April 11, 2003 Posted April 11, 2003 I have tried that but the database fields doesn't get updated or refreshed. Here's what I did at the begining. Because I want to compare the database field SSN to a run time variable intSSN, I decided to fill my dataset at run time instead of using the wizard. So the next problem for me is how do I bring those fields from the select query to the Database Field tree so I can design my report. I have no clue so there is a person on the net told me that I can do this: usrDataset.WriteXmlSchema("C:\temp\rprtSchema.xml") in my code and run the application to write the file. Then I can import that xml schema to the Database Field tree so I can design my report. If I know a better way to do what I wanted to do, I would but I'm new to VB.NET. Chong Quote
hog Posted April 12, 2003 Author Posted April 12, 2003 I do it another way. I have a dataset and dataadapter on my report form which I use in design time. I modify the select query to bring in the required new fields, veryify the database and the fields are there. Quote My website
Chong Posted April 14, 2003 Posted April 14, 2003 Hog, would you be kind enough to show me how to do it in your way? Or perhaps show me a link to do it in another way that would give me an update of the database fields whenever I changed my SQL query. Thank you very much! Chong Quote
hog Posted April 16, 2003 Author Posted April 16, 2003 In your report designer view, click on Field Explorer, right click on Database then select verify database. If you have made changes it will tell you the database is out of sync and allows you to resysnc it. If you make changes then do this but it says it can't find any changes then close .NET down and start it again and it will detect the changes. Works for me :-) Quote My website
Chong Posted April 16, 2003 Posted April 16, 2003 Thanks for helping me out. I'm greatly appreciated. I have tried the update like you suggested and it returns The Database is up to date but it never shows the new fields in the new table that I added to my SQL query. I wonder if this update will actually go through my SQL query and know that I've added a new table and show the fields in that table in the Database Field tree. Chong :confused: Quote
hog Posted April 16, 2003 Author Posted April 16, 2003 OK, in my case it works as I modify the SQL in the dataadapter to pull in the new fields. I generate the dataset then report design view, onto field explorer, verify database and it works? Quote My website
Chong Posted April 16, 2003 Posted April 16, 2003 But do you use the wizard to configure your DataAdapter? For mine, the DataAdapter are created and the DataSet are filled at run time. Chong Quote
hog Posted April 17, 2003 Author Posted April 17, 2003 OK, not sure if this is the most effcient but this is how I got it to work as cystal is different than Access reporting. In report design I have a dataadapter and dataset with the required fields for the report. I use this to design the report to start with. When I use the report at runtime I point the reports recordsource to a dynamic dataset which has the same fields as the one used fr design time. When I am happy with the report the design time one is deleted as it is no longer needed. During development if I realise the dynamic dataset requires additional fields that will need to be on the report, I modify the design time one to gain access to the field objects to place on the form. Like I say not the most effcicient but it works for me and I have not had any info yet on a better way to do it? Quote My website
Chong Posted April 17, 2003 Posted April 17, 2003 Yeah, I see your method. It works; however, will this method work? Write the XML schema to a file usrDataset.WriteXmlSchema("C:\temp\rprtSchema3.xml") and then copy whatever code is new, which is the latest table fields, into xml schema I used to generate the report at the first place. Chong Quote
hog Posted April 17, 2003 Author Posted April 17, 2003 The way to find out is to try it. I haven't directly modified XML yet so have no knowledge of doing it that way, although I can't see why it wouldn't? Quote My website
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.