Showing posts with label current. Show all posts
Showing posts with label current. Show all posts

Tuesday, March 20, 2012

Save time in Script Component which is almost forwarding

Hi,
I have to add the fields coming from the source AS IS but, I need to add current date as a column to it. So, What I do is to add an Script Component and add each and every output column in that along with defining their types and writing an "assignments" script.

Is there any possibility for me to save time in the scenarios where I am almost passing on the information to next level in the data flow ?

Any input regarding this will sincerely be appreciated.

FahadWhy can't you use a derived column transformation with getdate() as an expression? Using a derived column, you can add a new date column to your data flow.|||Thanks, I appreciate it.

Monday, March 12, 2012

save dr property to variable

how do you store a datareader propety to a variable? Below is my current code. I have already declared my connectionString and sqlComm objects, as well as the userName and such. I need to store the value from the dr to the variables, UserName, UserPass, and serverName. Thanks

Try sqlCon.Open() dr = sqlComm.ExecuteReaderWhile dr.Read userName = dr("uName").ToString LogInfo("userName = " & userName) userPass = dr("uPass").ToString LogInfo("userPass = " & userPass) serverName = dr("sName").ToString LogInfo("serverName = " & serverName)End While dr.Close()Catch obugAs Exception LogEvent("Credentials Error: " & obug.Message)Finally sqlCon.Close()End Try

You would set them exactly as you have done above (i.e. whilst inside the "dr.Read" while loop). Are you saying this doesn't work? If so, have you stepped through your code to see what is happening?

|||

Hi,

How many rows do you have in your table. If there is only one row and you want to store them into variables, its fine. However what if you have more than one rows? With each loop of your dr, your previous value in the variable will get lost.

Instead use a Generic List to store your values.

Checkthis sample.

HTH,
Suprotim Agarwal

--
http://www.dotnetcurry.com
--

|||

Got it to work. Since I had declared the variables as string, and did not fill them with anything, I was getting an error while trying to use the variables in some code after this dr object. Setting the variables to empty string resolved the errors:

Dim var AS String = ""

thanks for the responses.

Save As...Older version

I currently have Crystal Reports Version 9.0, but for a supporting application I need to have version 8.5. Is there a way that I can save my current reports as the older version 8.5?
Thanks in advance
JustinNo way with that version....

Luc