Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

A Dataset component that is NOT attached to a DB?

Posted on 2004-04-15
4
Medium Priority
?
857 Views
Last Modified: 2010-04-04
I am trying to use a Rave report on a set of data that is passed in to my application from a server: there is no database resident in the client application. The Rave report needs to run off a dataset, but the object that gets passed in is actually an array of created objects having parameters .Name, .Suburb, .State etc. (all strings). I then pull that apart to load it into a stringgrid for display, but I also need to be able to print it in Rave, which requires a Dataset.

I've tried to use a SimpleDataSet component, with data fields added independently, and then I tried to add data by:

      tblPrint.Append;
      tblPrintID.AsString := sgCompany.Cells[0,i+1];
      tblPrintTradingName.AsString := sgCompany.Cells[1,i+1];
      tblPrintSuburb.AsString := sgCompany.Cells[2,i+1];
      tblPrintState.AsString := sgCompany.Cells[3,i+1];
      tblPrintPostCode.AsString := sgCompany.Cells[4,i+1];
      tblPrintContactNumber.AsString := sgCompany.Cells[5,i+1];
      tblPrint.Post;

... but tblPrint (the SimpleDataSet) still seems to require attachment to a database and a table of some sort. I also tried a TTable but that involves including the BDE, which is not an option.

I guess what I really want is a 'virtual' table: something I can stack with data by code as above but without having to attach it to a real table or database. But it must be enough of a Dataset to appear in the pulldown list in the TRvDataSetConnection's Dataset property.  

Any suggestions?

MartinC
0
Comment
Question by:MartinC
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
4 Comments
 
LVL 12

Accepted Solution

by:
Lee_Nover earned 360 total points
ID: 10839392
no, not SimpleDataSet .. only ClientDataSet
you simply create new fields and call CreateDataSet (in design or runtime)
for loading from a file .. well .. you call LoadFromFile :)
0
 

Author Comment

by:MartinC
ID: 10839579
Hmmm. thanks Lee, but I still don't understand how this solves the problem. I have tried a ClientDataSet and it doesn't work either: it says "Missing Data Provider or Data Packet". I want an object that doesn't HAVE a DataProvider: I am supplying all the data anyway; there are no fields to enter.

MartinC
0
 
LVL 12

Expert Comment

by:Lee_Nover
ID: 10839732
as I said .. call CreateDataSet
it works at designtime as well (right click on the clientdataset)

simple example:

put a ClientDataSet (later refered to as CDS) on a form or datamodule
doubleclick it to open the fields editor
add new fields (Name, Suburb, State,... )
rightclick the CDS and click CreateDataSet - it will create the dataset and open it
from then on it's fully usable as an in-memory dataset

I use it like that very often
0
 

Author Comment

by:MartinC
ID: 10839851
Success! We had a fiddle with it and for anyone else following this thread the trick is to use CreateDataSet INSTEAD of Open ... you just use the dataset without ever opening it.

Thanks Lee, points to you ... got it answered just in time so I can deliver my project Phase 2 on schedule ... then walk out the door of my last day of work here! Got a new job in the big city!    

Martin C
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…
In this video, Percona Director of Solution Engineering Jon Tobin discusses the function and features of Percona Server for MongoDB. How Percona can help Percona can help you determine if Percona Server for MongoDB is the right solution for …
Suggested Courses

618 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question