[mapguide-users] after query generate a report

Daniel Du Daniel.Du at autodesk.com
Wed Apr 1 05:28:50 EDT 2009


Hi

What kind of report do you want? A HTML table? Here is a code snippet to generate a html table from a MapGuide query result .You can also generate a pdf by calling pdf realated API, I think it is nothing related to MapGuide API any more.

<code_begin>
String layerFeatureIdString = layer.GetFeatureSourceId();
                    MgResourceIdentifier layerResId = new MgResourceIdentifier(layerFeatureIdString);

                    MgFeatureQueryOptions queryOptions = new MgFeatureQueryOptions();
                    queryOptions.SetFilter(selectString);
                    MgFeatureReader featReader = featureService.SelectFeatures(layerResId, layerClassName, queryOptions);

                    outString = outString + "<table border=\"1\">\n";

                    double acre = 0;

                    while (featReader.ReadNext())
                    {
                        outString = outString + "<tr>\n";

                        outString = outString + "<td>";
                        outString = outString + featReader.GetString("RNAME");
                        outString = outString + "</td>\n";
                        outString = outString + "<td>";
                        outString = outString + featReader.GetString("RPROPAD");
                        outString = outString + "</td>\n";
                        outString = outString + "<td>";
                        String acreString = featReader.GetString("RACRE");
                        acre = acre + (acreString == "" ? 0 : Convert.ToDouble(acreString));
                        outString = outString + acreString;
                        outString = outString + "</tr>\n";

                    }
                    outString = outString + "</table>\n";

                   featReader.Close();

<code_end>

From: mapguide-users-bounces at lists.osgeo.org [mailto:mapguide-users-bounces at lists.osgeo.org] On Behalf Of Spencer Trevor
Sent: 2009Äê4ÔÂ1ÈÕ 17:16
To: mapguide-users at lists.osgeo.org
Subject: [mapguide-users] after query generate a report

hi there,
do anyone have a sample or a code to generate a report?
what i want to do is, first i want to do a simple query and then i want to generate a report base on the query that i have perform earlier.

do anyone have a sample or a code to generate a report?

thank you in advance.

regards.
Spencer Trevor

________________________________
Nama E-mel baru untuk anda! <http://sg.rd.yahoo.com/my/mail/domainchoice/mail/signature/*http:/mail.promotions.yahoo.com/newdomains/my/>
Dapatkan nama E-mel yang telah lama anda mahukan pada @ymail dan @rocketmail yang baru.
Cepat sebelum orang lain mendapatkannya!
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/mapguide-users/attachments/20090401/314925e9/attachment.html


More information about the mapguide-users mailing list