Topic: Dataset to recordset
Hello sibprogsystem....
I need your help...
I am retrieving data from mssql server database..
How to genrate report using fast report...
And how to convert recordset to dataset..
My Visual Database → General → Dataset to recordset
Hello sibprogsystem....
I need your help...
I am retrieving data from mssql server database..
How to genrate report using fast report...
And how to convert recordset to dataset..
blackpearl8534,
I know you have been asking this question on the Forum, but I am not aware of a way to go directly from a recordset to a dataset. I have not seen anything on that and without Dimitry's support I think you may be stuck. However, as an alternative you could populate a local temporary Sqlite database with your report records. Then you could report off of that. I have attached a sample. I do not have Sql Server so I used Access, but the concept is the same. I would recommend selecting only the records and fields needed for the report for efficiency purposes. I apologize if you already thought of this and determined that it is not workable.
Thanks ... k245 told me that i did not found any solution in mvd to genrate report from sql server... i think this is the best way to print my selected data...
Thank you very much to guide me...
hello K245 and ehwagner
i found a solution but not exactly working like i want...
i want to print all data but its print 1 row... please check it
blackpearl8534,
The reason you are only getting one row is because you are using variables. Variables only hold one instance of information. With each iteration of your while loop you are overriding the previous iteration of variables. So after you finish the while loop you load the report variables with essentially the last iteration of the recordset variables. That's why your report only shows the last record of the table.
Can we load all data????
Not without loading an Sqlite DB first. Unless Dimitry can provide another solution, I'm just not aware of another way.
Where is dmitry...
Is he supporting MVD now...
I am facing some problems to retrieve data from sql server...
I mean filter by datetime...
blackpearl8534,
Is there a reason why you can't use a temporary sqlite db for reporting purposes only.
blackpearl8534,
Is there a reason why you can't use a temporary sqlite db for reporting purposes only.
I'm up for this. You can load it into a temporary table on your sqlite, then print it.
Here I made some modifications on the script to give you an idea.
great example. thanks..
can you tell me how to load data using datetimepicker filter
great example. thanks..
can you tell me how to load data using datetimepicker filter
Just do a filter on your sqlite(temp) database
But i need filter on access db because i want to load filterd data not all...
But i need filter on access db because i want to load filterd data not all...
Well, I'm not sure why you would want that when filtering in MVD with sqlite will give you less time to spend.
But if you insist, then try to integrate Filtering on MS SQL with script and queries.
I found some here
https://stackoverflow.com/questions/424 … access-sql
Then do something like
procedure Form1_Button1_OnClick (Sender: TObject; var Cancel: boolean);
var
i: Integer;
_id, _num, _txt, _date: String;
_fdate1, _fdate2: String;
begin
LoadStatus('Opening Database...');
_fdate1 := FormatDateTime('yyyy,MM,dd', Form1.f_from.DateTime);
_fdate2 := FormatDateTime('yyyy,MM,dd', Form1.f_to.DateTime);
rs.Open('SELECT id,sampleNumber,sampleShortText,sampleDate FROM SampleTable WHERE sampleDate BETWEEN DateSerial('+_fdate1+') AND DateSerial('+_fdate2+')', Conn);
//rs.Open('SELECT id,sampleNumber,sampleShortText,sampleDate FROM SampleTable WHERE sampleDate BETWEEN DateSerial(2021,08,04) AND DateSerial(2021,08,29)', Conn);
thanks for reply...
.basically i have a software that is connected to fuel dispensers and stores data into mssql database.
i am developing an external software that print data and generate summary. that is reason to filter data directly from sql database...
hello... after struggle of many hours i found datetime format to retrieve data from sql server database...
but now how to add Datetime picker is this formate...
because when i set ''mypicker'' then sql throw error.... please check it in Uploaded pic and see carefully...
Try this
hd.Completed_TS >= ' + _fromTime + ' Order By...
You may need to put quotes around it as follows
hd.Completed_TS >= "' + _fromTime + '" Order By...
thanks ehwagner working Properly
how to write sql query if filter variable is null
Not exactly sure what you mean. Are you using a SqlQuery button or SqlExecute script? If you are using a SqlQuery button and you want all records when the variable is empty, the easiest way I can think of is to create another SqlQuery button with the WHERE clause removed, then check for the existence of the variable and script click on the appropriate button. You could do the same with SqlExecute only you would remove the WHERE clause in the script rather than having a separate button. Maybe you could explain a little more if I am off base.
Thanks....ehwagner
I am using query in rs.open('my sql query')
I applied a condition if combobox value is > 0 then my query so i wrote 4 queries with different clauses. Now its working...
Awesome!
My Visual Database → General → Dataset to recordset
Powered by PunBB, supported by Informer Technologies, Inc.
Theme Hydrogen by Kushi