tendaimare's Profile User Rating: -----

Reputation: 1 Apprentice
Group:
Active Members
Active Posts:
178 (0.11 per day)
Joined:
04-November 10
Profile Views:
2,971
Last Active:
User is offline Apr 09 2015 08:14 AM
Currently:
Offline

Previous Fields

Dream Kudos:
0
Icon   tendaimare has not set their status

Posts I've Made

  1. In Topic: Load crystal report by name

    Posted 9 Apr 2015

    My challenge is to convert the string in the Combobox to a reportDocument object. This code does it, but when I run it the value of myReport is Nothing
      Dim myReport As ReportDocument = CType(Controls(Combobox .Text.Remove(Combobox .Text.Length - 4)), Object)
            My_Report_Viewer.StandardView.ReportSource = myReport
            My_Report_Viewer.StandardView.RefreshReport()
            My_Report_Viewer.ShowDialog()
    
    

    Its unforunate I cant say
         My_Report_Viewer.StandardView.ReportSource = New Combobox .Text  
    
    but this is where I am at, trying to convert the text from the combobox to an object. The text in the Combobox would typicaally be something like "my_PrintForm_Fuel_Report.RPT" I am trying to run away from having to specify the path to the report
  2. In Topic: Load crystal report by name

    Posted 9 Apr 2015

    This is how I load the code for the combobox. Its a telerik combobox so the code is heavy. But the combobox has text in it which is the Reportname eg "my_PrintForm_Fuel_Report.RPT" which is the name of the crystalreport object, now i am trying to use this name to load the report. I first remove the".RPT" part so that what remains is the class name of the crystalreport file. I am now attempting to use this report file name to load the report using
    My_Report_Viewer.StandardView.ReportSource = New my_PrintForm_Diesel_Charge_Outs
    
    But after the New keyword it expects classname and not myCombobox.Text which is where I am stuck


    
    
            Dim myConnectionselection As String
            Dim myTableName As String
            Dim myDisplayMember As String
            Dim myDisplayHeaderText As String
            Dim myConditionalSelectionFieldName As String
            Dim myConditionalSelectionFieldValue As String
            Dim myOrderByFieldName As String
            Dim myOrderBySequenceAscDesc As String
            Dim SetmyConnection As String
            Dim SetmyAdapter As String
            Dim SetmyDataset As String
            Dim myBlankTitleDescription As String
    
            Dim myConnection As New OleDbConnection(myDefaultConnectionString)
            Dim myAdapter As New OleDbDataAdapter()
            Dim myDataset As DataSet = New DataSet("SetmyDataset")
            Dim myComboBox As RadMultiColumnComboBox
    
            '============================= Default Values go here ===========================
    
            'Enter the Name of the ComboBox Here ....
    
            myComboBox = cmbAvailableReports
    
            ' Enter the title text to display in the combo Box here ...
    
            myBlankTitleDescription = " Select Fleet group"
    
            ' Enter the Database Table Name Here .......
    
            myTableName = "my_Available_Reports"
    
            ' Enter the Name of thr field that you want to display here...
    
            myDisplayMember = "ReportDisplayTitle"
    
            'Enter Header Text Title here ....
    
            myDisplayHeaderText = "Available Reports"
    
            ' Enter the field Name for the conditional selection here ....
    
            myConditionalSelectionFieldName = "isActive"
    
            ' Enter the Value of the Field for the selection criteria here ...
    
            myConditionalSelectionFieldValue = "TRUE"
    
            'myConditionalSelectionFieldValue = "Receipts"
    
            'Enter the name of the field to sort by here ...
    
            myOrderByFieldName = "ReportDisplayTitle"
    
            'Enter the Sort order either Ascending or Descending here ...
    
            myOrderBySequenceAscDesc = "ASC"
    
            '=========================================================================
    
            myConnectionselection = "SELECT  DISTINCT('   '+" & myDisplayMember & ") as myDisplayCombo," & myDisplayMember & " FROM " & myTableName & " WHERE " & myConditionalSelectionFieldName & "  = " & myConditionalSelectionFieldValue & "  AND ReportGroup='Diesel' "
    
            SetmyConnection = myTableName & "Connection"
    
            myConnection.Open()
    
            SetmyAdapter = myTableName & "Adapter"
    
            myAdapter.SelectCommand = New OleDbCommand(myConnectionselection, myConnection)
    
            SetmyDataset = myTableName & "Dataset"
    
            myAdapter.Fill(myDataset)
    
            myConnection.Close()
    
            myComboBox.DataSource = myDataset.Tables(0)
    
            myComboBox.DisplayMember = myDisplayMember
    
            myComboBox.MultiColumnComboBoxElement.Columns("myDisplayCombo").HeaderText = myDisplayHeaderText
            myComboBox.MultiColumnComboBoxElement.Columns("myDisplayCombo").HeaderTextAlignment = ContentAlignment.MiddleCenter
    
            myComboBox.MultiColumnComboBoxElement.Columns(myDisplayMember).IsVisible = False
    
            myComboBox.MultiColumnComboBoxElement.Columns(myDisplayMember).ReadOnly = True
    
            'Formatting Starts Here
    
            myComboBox.AutoScroll = True
            myComboBox.AutoSizeDropDownHeight = True
            myComboBox.MultiColumnComboBoxElement.AutoSizeDropDownToBestFit = True
            myComboBox.MultiColumnComboBoxElement.EditorControl.AutoSizeColumnsMode = GridViewAutoSizeColumnsMode.Fill
            myComboBox.MultiColumnComboBoxElement.DropDownSizingMode = SizingMode.UpDownAndRightBottom
            myComboBox.MultiColumnComboBoxElement.DropDownStyle = RadDropDownStyle.DropDown
    
            myComboBox.MultiColumnComboBoxElement.DropDownAnimationEnabled = True
    
            myComboBox.MultiColumnComboBoxElement.EditorControl.HorizontalScrollState = ScrollState.AutoHide
            myComboBox.MultiColumnComboBoxElement.EditorControl.VerticalScrollState = ScrollState.AutoHide
            myComboBox.MultiColumnComboBoxElement.EditorControl.ShowColumnHeaders = True
            myComboBox.MultiColumnComboBoxElement.EditorControl.EnableFiltering = True
            myComboBox.MultiColumnComboBoxElement.EditorControl.EnableSorting = True
            myComboBox.MultiColumnComboBoxElement.EditorControl.Padding = New Padding(4, 5, 5, 2)
            myComboBox.MultiColumnComboBoxElement.TextBoxElement.Padding = New Padding(10, 10, 5, 10)
            myComboBox.MultiColumnComboBoxElement.EditorControl.EnableAlternatingRowColor = True
            myComboBox.MultiColumnComboBoxElement.EditorControl.SelectionMode = GridViewSelectionMode.FullRowSelect
            myComboBox.EditorControl.TableElement.Font = mySystemDefaultFont
            myComboBox.Font = myTextboxFont
            myComboBox.EditorControl.TableElement.RowHeight = myComboboxRowHeight
            myComboBox.EditorControl.TableElement.TableHeaderHeight = myComboboxHeaderHeight
    
            ' Filtering Starts Here
    
            myComboBox.AutoFilter = True
            Dim filter As New FilterDescriptor()
            filter.PropertyName = myComboBox.DisplayMember
            filter.Operator = FilterOperator.StartsWith
            myComboBox.EditorControl.MasterTemplate.FilterDescriptors.Add(filter)
    
    
  3. In Topic: saving data in database and moving to next form

    Posted 5 Feb 2015

    Thanks so much CreamDelight I did what you said and it works well I even went forward to create a sort of a list of the data in the table. This is the final result.
    In myFriends.php
    <!DOCTYPE html>
    <html>
    <body>
    <?php
    $name = isset($_REQUEST['name']) ? $_REQUEST['name'] : "";
    $email = isset($_REQUEST['email']) ? $_REQUEST['email'] : "";		
    ?>
    <form action="welcome.php" method="post">
    Name : <input type="text" name="name" value="<?php echo $name; ?>"><br>
    Email : <input type="text" name="email" value="<?php echo $email; ?>"><br></br><br></br>
    <input type ="submit" name="save" value="Save">
    </form>
    </body>
    </html>
    
    

    And this is the code in welcome.php
    
    <html>
    <body>
    Welcome <?php echo $_POST["name"]; ?><br>
    Your E mail address is: <?php echo $_POST["email"]; ?>
    
    <?php
    $nameErr = $emailErr = "";
    
    $name = isset($_REQUEST['name']) ? $_REQUEST['name'] : "";
    $email = isset($_REQUEST['email']) ? $_REQUEST['email'] : "";
    	
    if ($_SERVER["REQUEST_METHOD"] == "POST") {
    $name = test_input($_POST["name"]);
    $email = test_input($_POST["email"]);  
    }
    
    function test_input($data) {
      $data = trim($data);
      $data = stripslashes($data);
      $data = htmlspecialchars($data);
      return $data;
     }
    	
    if (isset($_REQUEST['save']))
    {		
    $servername="localhost";
    $username="root";
    $password="";
    $conn=mysqli_connect($servername,$username,$password,"myDB");
    if (!$conn){
    	
    	die("Connection failed: " .mysqli_connect_error() . "<br></br>" . "<br></br>");
    	}
    	echo "Connected successfully" . "<br></br>" . "<br></br>";
    		
    $sql="INSERT INTO MyFriends (name,email) VALUES ('$name','$email')";	
    	
    if ($conn-> query ($sql) === TRUE){	
    	echo "New record created successfully." . "<br></br>" . "<br></br>"; 
    	$name="";
    	$email="";
    }	else {
    	echo "Error " . mysqli_error($conn). "<br></br>" . "<br></br>";
    }
    	$conn->close();
    }
    
    ?>
    
     <?php
     $servername="localhost";
    $username="root";
    $password="";
    $conn=mysqli_connect($servername,$username,$password,"myDB"); 
     if (!$conn){	
    	die("Connection failed: " .mysqli_connect_error() . "<br></br>" . "<br></br>");
    	}
    	echo "Connected successfully" . "<br></br>" . "<br></br>";	
    $sql = "SELECT id,name,email FROM MyFriends";
    $result = mysqli_query($conn, $sql);
    
    if (mysqli_num_rows($result) > 0) {
        // output data of each row
        while($row = mysqli_fetch_assoc($result)) {
            echo "id: " . $row["id"]. " - Name: " . $row["name"]. " " . $row["email"]. "<br>";
        }
    } else {
        echo "0 results";
    }
    	$conn->close();
    ?>  
    </body>
    </html>
    
    
  4. In Topic: Notice: Undefined index: name in C:\..\myTest.php

    Posted 4 Feb 2015

    Thank you the error is no longer showing up your answers really solved my problem and my form is showing up without the errors.
  5. In Topic: Notice: Undefined index: name in C:\..\myTest.php

    Posted 4 Feb 2015

    Thank you . Your answer really helped me now when I click the Save button the code does not crash and give an error. When I call the page in IE it still shows up with the same Notice: Undefined index: name in C:\wamp\www\Computerize\myFriends.php on line 7 error.

    Any ideas on how I can solve this error, I am new php but I have experience in VB.Net and C# windows forms and this is completely new to me.

    I am suspecting that my variables are not in the right place or something along those lines but I need help on how I can fix it.

My Information

Member Title:
D.I.C Head
Age:
Age Unknown
Birthday:
Birthday Unknown
Gender:

Contact Information

E-mail:
Private

Friends

Comments

tendaimare has no profile comments yet. Why not say hello?