Reports: LoadSettings Error |
Post Reply |
Author | |
DDJJ
Senior Member Joined: 13 December 2004 Status: Offline Points: 143 |
Post Options
Thanks(0)
Posted: 12 January 2005 at 11:19am |
I keep getting an error when I use the LoadSetting method ("method of object...failed). Is there any documentation out there besides what little bit is in the help file?
|
|
dlord
Newbie Joined: 25 October 2004 Location: United States Status: Offline Points: 25 |
Post Options
Thanks(0)
|
It works good for me. Here is a clip of the code for Save and Load. Enjoy - Private Sub cmdSaveReport_Click() Dim FreeF As String Private Sub File1_Click() |
|
DDJJ
Senior Member Joined: 13 December 2004 Status: Offline Points: 143 |
Post Options
Thanks(0)
|
That's pretty much the exact same code I'm using, without any luck. Is it possible that my property settings for the report control might impact this? For example, the various edit settings, etc. Thanks! Dan |
|
dlord
Newbie Joined: 25 October 2004 Location: United States Status: Offline Points: 25 |
Post Options
Thanks(0)
|
Humm, I'm not sure. Are there any other signs of problems with your report performing other functions. Is that the whole error message...? Sorry that didn't help |
|
ianp
Moderator Group Joined: 19 December 2003 Location: United Kingdom Status: Offline Points: 119 |
Post Options
Thanks(0)
|
Hi Dan - any chance you can post your code? Also, I've come across this error if the number (and order of) columns added to the control, does not correspond to the column configuration in the settings string... |
|
DDJJ
Senior Member Joined: 13 December 2004 Status: Offline Points: 143 |
Post Options
Thanks(0)
|
Here's the code used to save/load the report settings (note that the code verify's whether a file has already been created to save the settings for the particular report): Private Sub SaveReportSettings(sType As String) Dim FreeF As Integer, sFile As String, sLayout As String End Sub If VerifyFile(App.Path & "\" & sType & ".000") Then Here's the code setting up the report: Private Sub CreateItemReport(sFilter As String) 'Add Records to the ReportControl End Sub Here's the code writing the data to the report: Private Sub AddItemRecord(objItem As Object, lItemID As Long, sID As String, _ Hopefully, this helps. Let me know if you need any add'l info. Thanks! |
|
DDJJ
Senior Member Joined: 13 December 2004 Status: Offline Points: 143 |
Post Options
Thanks(0)
|
Maybe I'll try to jumpstart this again... I think the problem might relate to what I expect the LoadSettings/SaveSettings methods do. I had thought that we (the developer) could create a report in code, adding columns to the report as well as determining which columns would be visible the first time the user views the report. Once the user has viewed the report, and added or deleted available columns from the view to meet their (the user's) needs, we could then save the user's "settings" and therefore NOT have to load the columns the next time around, just the data. The user's column settings (which columns are visible, how they are aligned, etc.) would thereby be maintained from one session to the next. The columns available to the user will always stay the same...just which ones are visible, the widths, alignment, etc., would change from session to session. Am I thinking this through correctly? |
|
DDJJ
Senior Member Joined: 13 December 2004 Status: Offline Points: 143 |
Post Options
Thanks(0)
|
OK. I talked my way through it and figured it out. As noted above, I had thought that the Load/Save Settings methods removed the need to even load the columns each time the user opened a report. The key is that these methods load and save column "settings" vs. the column "definitions" (for the lack of a better word to use). Once I started loading the definitions again, before running the LoadSettings method, it works beautifully with all of the appropriate "settings" in place. Maybe I'm just slow, but I don't think the documentation was really helpful here. That's OK. I still like the tools. |
|
Post Reply | |
Tweet
|
Forum Jump | Forum Permissions You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |