Jump to content


Photo

Grid Output to XML - and to stream


  • Please log in to reply
8 replies to this topic

#1 mcinternet

mcinternet
  • Members
  • 93 posts
  • Gender:Male

Posted 07 May 2007 - 02:37 PM

Hi Boki,

in Moment it is possible to create an output to textfile, html and ini. It would be nice, if there would be also a possibility to create an output to stream (p.e. grid.savetostream(_sstream)) where _sstream is type TStringStream.

A further feature (and this I need "urgent") is, an output to an xml-file. => grid.savetoxml("file.xml").

There is no need to generate the whole xml-header! <?xml version="1.0" encoding="ISO-8859-1"?>. There should be a true (with header) and a false (without header).
the grid lines shoud be in this form:
<gridname_line01><name_of_1st_column>payload</name_of_1st_coloumn><name_of_2nd_column>payload</name_of_2nd_column></gridname_line01>

Can you tell me that this is possible? And if, then how fast?

thx in adv

brgds

McInternet

#2 Boki (Berg)

Boki (Berg)

    Boki (Berg)

  • Forum Admin
  • PipPipPipPipPip
  • 7,742 posts
  • Gender:Male

Posted 07 May 2007 - 03:23 PM

Hello McInternet,

Saving into XML file may be done easy, but loading may be trouble (LoadFromXMLFile).

Saving and Loading from Stream is easier solution.

I have start work on SaveToStream after reading your post, but it will need several days to finish it.

Best regards
boki@bergsoft.net | LinkedIn Profile
--
BergSoft Home Page: www.bergsoft.net
Members Section: bms.bergsoft.net
Articles and Tutorials: dn.bergsoft.net (Developers Network)
--
BergSoft Facebook page
--
Send us applications made with our components and we will submit them on: www.bergsoft.net/apps.htm. Link to this page will be also set on home page too.

#3 wvd_vegt

wvd_vegt

    Master Member

  • Honorable Members
  • PipPipPipPipPip
  • 710 posts
  • Gender:Male
  • Location:the Netherlands

Posted 07 May 2007 - 10:47 PM

Hi,

I think i posted code for xml saving & loading in the user contributions forum as a set of functions that take a Nextgrid as parameter, thus not interfering with the nextsuite codebase itself.
G.W. van der Vegt

#4 Boki (Berg)

Boki (Berg)

    Boki (Berg)

  • Forum Admin
  • PipPipPipPipPip
  • 7,742 posts
  • Gender:Male

Posted 07 May 2007 - 11:29 PM

Hello Wim and Mc,

Do you maybe have some suggestions about how to store cells into StringStream?

CODE
procedure TNxCustomGridControl.SaveToStream(Stream: TStream);
var
  S: string;
begin
  S := GetTextStr;
  Stream.WriteBuffer(Pointer(S)^, Length(S));
end;


I am now working on GetTextSr and I am wondering how it will be best to store strings in it. I am thinking about putting cell in one array structure:

Cell11
Cell21
Cell31
Cell12
Cell22
Cell32
Cell13
Cell23
Cell33

regards
boki@bergsoft.net | LinkedIn Profile
--
BergSoft Home Page: www.bergsoft.net
Members Section: bms.bergsoft.net
Articles and Tutorials: dn.bergsoft.net (Developers Network)
--
BergSoft Facebook page
--
Send us applications made with our components and we will submit them on: www.bergsoft.net/apps.htm. Link to this page will be also set on home page too.

#5 mcinternet

mcinternet
  • Members
  • 93 posts
  • Gender:Male

Posted 08 May 2007 - 12:46 AM

QUOTE (Boki (Berg) @ May 8 2007, 12:29 AM) <{POST_SNAPBACK}>
Hello Wim and Mc,

Do you maybe have some suggestions about how to store cells into StringStream?

CODE
procedure TNxCustomGridControl.SaveToStream(Stream: TStream);
var
  S: string;
begin
  S := GetTextStr;
  Stream.WriteBuffer(Pointer(S)^, Length(S));
end;


I am now working on GetTextSr and I am wondering how it will be best to store strings in it. I am thinking about putting cell in one array structure:

Cell11
Cell21
Cell31
Cell12
Cell22
Cell32
Cell13
Cell23
Cell33

regards


Hi Boki,

I think, the best would be, if you donĀ“t make an array structure. It would take a stringlist, line by Gridline, cells separeted by for ex. | or let the user choose, what he wants to take for.

brgds

McInternet

#6 mcinternet

mcinternet
  • Members
  • 93 posts
  • Gender:Male

Posted 08 May 2007 - 12:47 AM

QUOTE (wvd_vegt @ May 7 2007, 11:47 PM) <{POST_SNAPBACK}>
Hi,

I think i posted code for xml saving & loading in the user contributions forum as a set of functions that take a Nextgrid as parameter, thus not interfering with the nextsuite codebase itself.

Hi wvd,

I made a new XML ex-and import by myself => Users contribution

pls. have a look and try.

brgds

McInternet

#7 wvd_vegt

wvd_vegt

    Master Member

  • Honorable Members
  • PipPipPipPipPip
  • 710 posts
  • Gender:Male
  • Location:the Netherlands

Posted 09 May 2007 - 12:11 AM

Hi,

I noticed that you use a xml library (i must have a look at it if it's freeware as i'm always curious). Btw thanks for posting (I was getting a bit lonely in the user contributions forum ;-).

My code doesn't use any third part components (so does not need anything extra to be installed).

QUOTE (mcinternet @ May 8 2007, 01:47 AM) <{POST_SNAPBACK}>
Hi wvd,

I made a new XML ex-and import by myself => Users contribution

pls. have a look and try.

brgds

McInternet

G.W. van der Vegt

#8 Boki (Berg)

Boki (Berg)

    Boki (Berg)

  • Forum Admin
  • PipPipPipPipPip
  • 7,742 posts
  • Gender:Male

Posted 09 May 2007 - 02:47 AM

Hello,

I am thinking about developing some very very lite XML component for this situations and place this component in NxCommonRun package.

This component may help for such routines and for some small task and it will not require component from outside (or heavy ActiveX MSXML component)

regards
boki@bergsoft.net | LinkedIn Profile
--
BergSoft Home Page: www.bergsoft.net
Members Section: bms.bergsoft.net
Articles and Tutorials: dn.bergsoft.net (Developers Network)
--
BergSoft Facebook page
--
Send us applications made with our components and we will submit them on: www.bergsoft.net/apps.htm. Link to this page will be also set on home page too.

#9 mcinternet

mcinternet
  • Members
  • 93 posts
  • Gender:Male

Posted 09 May 2007 - 02:50 AM

QUOTE (wvd_vegt @ May 9 2007, 01:11 AM) <{POST_SNAPBACK}>
Hi,

I noticed that you use a xml library (i must have a look at it if it's freeware as i'm always curious). Btw thanks for posting (I was getting a bit lonely in the user contributions forum ;-).

My code doesn't use any third part components (so does not need anything extra to be installed).

Hoi,

the simploXML ist free

brgds

McInternet




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users