Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

refresh exits before refresh finishes

Status
Not open for further replies.

kalkalai

Technical User
Feb 24, 2006
33
0
0
KZ
Hi ALL,

first all HAPPY NEW YEAR all MEMBERS of this SITE!

My question is related to refresh method of busobj (I am using BO version 5.1.6)... My code is below

<code>
For Count1 = LBound(TxtNames_H) To UBound(TxtNames_H)
'MsgBox (TxtNames(Count))
Set Doc = Application.Documents.Open("C:\BOReports\" & RepNames(Count1) & ".rep", _
True, False, False, False)



For VariableCount = 1 To Doc.Variables.Count
'MsgBox (Doc.Variables.Item(VariableCount).Name)
If Doc.Variables.Item(VariableCount).Name = "1. Resolution:" Then
Doc.Variables.Item(VariableCount).Value = "Hour"
ElseIf Doc.Variables.Item(VariableCount).Name = "2. Start Time:" Then
Doc.Variables.Item(VariableCount).Value = "04.11.2007 00:00:00"
ElseIf Doc.Variables.Item(VariableCount).Name = "3. Stop Time:" Then
Doc.Variables.Item(VariableCount).Value = "06.12.2007 00:00:00"
End If
Next VariableCount

Doc.Refresh
Doc.Save
Doc.SaveAs ("C:\BOReportsResults\" & TxtNames_H(Count1) & ".txt")




Doc.Close
Next Count1
</code>

After the refreshing the document it had to save all the data to txt file named in variant array...

But what happens is some of the txt files are empty... When I open the report select for the same time period it works fine and then I save it to txt file... it works... But When I run the above code some of the txt files are empty.

I really don't see the problem clearly, but I assume that it should be waiting after the refresh doesn't it? If so is there any method to do so.

Thanks in advance!
 
Do you need the 'if then else' construction?

Why not:

Code:
Doc.Variables("1. Resolution").Value = "Hour"
Doc.Variables("2. Start Time:").Value = "04.11.2007 00:00:00"
Doc.Variables("3. Stop Time:").Value = "06.11.2007 00:00:00"

The formatting of the date/time strings looks peculiar as well..

Ties Blom

 
Thanks Ties Blom,

I was just thinking of different things at that time...

But, why does the refresh saves empty txt files when I run the above vb code... Thanks in advance!
 
Does the report return data if you run it by hand with that 'peculiar' formatted datetime?

Ties Blom

 
Yes Ties Blom, that's what is strange!
 
Yes Ties Blom, that's what is strange! What kind of date format you would suggest me Ties Blom? Thanks in advance!
 
Depends on a number of factors, including database and local settings. Take the SQL from the report and run it directly against the database. What format is parsed?
Ditto for running the report manually..

Standard formats can be like 'dd-mm-yyyy hh:mi:ss'
The format dd.mm.yyyy hh:mi:ss looks peculiar to me..

Did you check the LOV on the prompt and how the datetime values are formatted?

Ties Blom

 
Ties Blom,

Format of the date seems to be correct, but this is on my machine on different machine it may differ...
 
List of values. full client stores this lists locally as .lov files. This makes selecting prompt input much faster (untill you need to refresh them)

Ties Blom

 
Ties Blom,

Thanks for info... Then what may be the reason I get the empty txt files...?
 
Forget the LOV for a moment. When you run the report manually, without using VBA, how do you select the input for the datetime prompts (prompts 2 and 3)
Is the input formatted like 'dd.mm.yyyy hh:mi:ss' ?

Ties Blom

 
yes Ties Blom,

now i am going home, will enter Internet from there... Waiting for your response!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top