Jump to content

geeknout

New Members
  • Posts

    5
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

geeknout's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Ok not sure why this was moved to SQL Server since its a PHP question, but hey whatever... I'm getting close can someone elaborate: <?php include("includes/dbconn.php"); if ($conn === 'false') { echo "Ooops!"; } else { $query = "SELECT * from customers"; $result = mysql_query($query) or die(mysql_error()); while($row=mysql_fetch_assoc($result)) { echo "<br />"; echo $row['customerNumber']; //displays all the customer numbers foreach($row as $cusno) { // This doesnt seem to be running... $query2 = "SELECT * FROM orders WHERE customerNumber = '%s'"; mysql_real_escape_string($cusno); $result2 = mysql_query($query2) or die(mysql_error()); while($row2=mysql_fetch_object($result2)) { echo "<br />"; echo "Got this far."; //not getting this far just here to see if I can as I run my page. } } } } mysql_close($conn); unset($row); ?>
  2. Hey Guys, I can get the data from sqlsrv but I can't figure out how to format similar to a crystal report.. i.e. something like: Find a specific customer number Print out the number, plus the customer name then: find all the rows that have the customer number and print them. I can get all the information obviously, but I'm not good enough with PHP yet to find similar to the above. Here is how I pull my data out if your curious: while( $obj = sqlsrv_fetch_object( $stmt)) { $reqshipdt = date("d M Y", strtotime($obj->req_ship_dt)); $popstdt = date("d M Y", strtotime($obj->start_dt)); $reqshipdt1 = date(strtotime($obj->req_ship_dt)); $popstdt1 = date(strtotime($obj->start_dt)); $datediff = ($reqshipdt1 - $popstdt1); $days = round($datediff / 86400); //gives how many days echo "<tr>"; echo "<td>". $obj->item_no."</td>"; echo "<td>".$obj->item_desc_1."</td>"; echo "<td>".$obj->ord_no."</td>"; echo "<td>".$obj->qty_ordered."</td>"; echo "<td>".$obj->mfg_ord_no."</td>"; echo "<td>".$reqshipdt."</td>"; echo "<td>".$obj->oe_po_no."</td>"; echo "<td>".$obj->prod_cat."</td>"; echo "<td>".$popstdt."</td>"; echo "<td>".$days." Day(s)</td>"; echo "<td>".$obj->planning_lead_tm."</td>"; echo "</tr>"; } Hope this makes sense on what I'm trying to shoot for. Thanks Guys and Gals.
  3. Hey guys, Fairly new to php development, so I apologize if this seems trivial, but I'm not finding answers... Anyway, I am working on rewriting an internal application that currently they enter a supplier part number and it will autopopulate some other boxes on the same form with data from the DB, basically just information about the supplier... I have looked for the last two days to find something close, but i'm not getting anything.. does anyone have a suggestion? I'm ok with just a point in the right direction maybe..
  4. Just to give someone an idea, this one almost worked... meaning it seems like it reads the file, but never displays it. Of course I have to be able to pass information to Crystal $COM_Object = "CrystalRuntime.Application.8.5"; $my_report = "C:\\filename.rpt"; $my_pdf = "C:\\filename.pdf"; $crapp= New COM($COM_Object) or die("Unable to Create Object"); $creport = $crapp->OpenReport($my_report, 1); $creport->ReadRecords(); // attention! $creport->ExportOptions->DiskFileName=$my_pdf; $creport->ExportOptions->PDFExportAllPages=true; $creport->ExportOptions->DestinationType=1; // Export to File $creport->ExportOptions->FormatType=31; // Type: PDF $creport->Export(false); //------ Release the variables ------ $creport = null; $crapp = null; $ObjectFactory = null
  5. Hey Guys/Gals, I have been searching for a week now all over the web on how to possibly get cyrstal reports to open in php. I have been close a couple of times, but nothing definative. Its hard to believe that nobody has done this, there has to be an effective way. Any thoughts out there? Has anyone here done that?
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.