Data grids? I want to be able to display a report!

Discussion in 'iPad Development' started by Myriad_Rocker, Jul 29, 2010.

  1. Myriad_Rocker
    Offline

    Myriad_Rocker iPF Noob

    Joined:
    Jul 29, 2010
    Messages:
    6
    Thanks Received:
    0
    Trophy Points:
    0
    Location:
    United States
    Ratings:
    +0 / 0
    Hey all, how's it going? I'm totally new to this thing. I've done a Hello World app using the iPhone SDK and that's about the extent of my knowledge so far. I have a programming background but it's all been Windows based using ASP.Net. I took a C++ class in college but that's as far as my C knowledge goes!

    Anyway, the company I work for has charged me with creating an iPhone/iPad app that will allow our customers to run simple reports. We work in the retail world so the reports will show something like sales data by store number. The user keys in the store number(s), hits "GO", and a report pops up in a datagrid.

    Problem is, I want to just simply start with trying to populate a datagrid with some data and I don't know how to get started. I've researched, Googled, and even followed a tutorial on the Table View object (was NO help and their XCode interface had different things than mine did).

    So...how do I go about getting started with doing something like this? I just want to be able to connect to a database and run some sql to fetch some data back into a datagrid. Seems easy enough and I could do it pretty quickly in an ASP.Net environment, but this whole iPhone/iPad thing is new to me.

    Appreciate any help.
  2. MikesTooLz
    Offline

    MikesTooLz Super Moderator Staff Member

    Joined:
    May 7, 2010
    Messages:
    2,364
    Thanks Received:
    19
    Trophy Points:
    0
    Location:
    Miami, FL
    Ratings:
    +20 / 0
    To get this up quickly I suggest you use what you already know. ASP.net before moving to something more complicated like populating tableviews and making data grids.

    Let the user enter the info, hit GO and then all the data you want gets requested via an asp.net page you have setup and displayed to the user in a UIWebView

    You can then make the app a little more usefull than a website would be by added something like a button called Near By Stores. The click it and the app checks GPS coordinates and displays the nearest X number of stores. They then can get info quickly for what ever stores are nearby as well as manualy entering a store #.

    This is all done while keeping most of your code in the ASP.net language that you already know well. Iphone app just passes info to your page and requests the info be displayed back as a webpage.
  3. Myriad_Rocker
    Offline

    Myriad_Rocker iPF Noob

    Joined:
    Jul 29, 2010
    Messages:
    6
    Thanks Received:
    0
    Trophy Points:
    0
    Location:
    United States
    Ratings:
    +0 / 0
    I like this idea. However, would I have to use Safari?
  4. MikesTooLz
    Offline

    MikesTooLz Super Moderator Staff Member

    Joined:
    May 7, 2010
    Messages:
    2,364
    Thanks Received:
    19
    Trophy Points:
    0
    Location:
    Miami, FL
    Ratings:
    +20 / 0
    No, when you put a UIWebview inside your app its almost like dragging and dropping a small safari browser window into the app.

    it all would be displayed right inside the app. the users may not even notice that its a webpage thats being displayed.
  5. Myriad_Rocker
    Offline

    Myriad_Rocker iPF Noob

    Joined:
    Jul 29, 2010
    Messages:
    6
    Thanks Received:
    0
    Trophy Points:
    0
    Location:
    United States
    Ratings:
    +0 / 0
    Nice. I'll see what the boss says about that.
  6. MikesTooLz
    Offline

    MikesTooLz Super Moderator Staff Member

    Joined:
    May 7, 2010
    Messages:
    2,364
    Thanks Received:
    19
    Trophy Points:
    0
    Location:
    Miami, FL
    Ratings:
    +20 / 0

    the upside of doing this also is that you can make changes and updates to what is displayed to the user without requiring new versions of the app to be downloaded and installed. Changing apps and getting the updates out to the users can been a long process. and if you go through the apple app store its two weeks for them to review the app before approving the update and making it available for users to download.
  7. Myriad_Rocker
    Offline

    Myriad_Rocker iPF Noob

    Joined:
    Jul 29, 2010
    Messages:
    6
    Thanks Received:
    0
    Trophy Points:
    0
    Location:
    United States
    Ratings:
    +0 / 0
    Sounds like the boss is good with that. Thanks for the suggestion. I guess I'll get to work on this. He said that we can just display static data for now and if we can get that working, we can start pulling in real data.

    Now...to get started...is there a tutorial on the UIWebView? :D
  8. MikesTooLz
    Offline

    MikesTooLz Super Moderator Staff Member

    Joined:
    May 7, 2010
    Messages:
    2,364
    Thanks Received:
    19
    Trophy Points:
    0
    Location:
    Miami, FL
    Ratings:
    +20 / 0
    Its rather simple, In my app I have setup a UIWebview named PictureWebView that displays photo's users have uploaded to the web. Here is how I tell the UIWebview to load the website.

    Code:
    //tell the UIWebView to load the page.
    	NSString *webLink = @"http://mikestoolz.com/";
    	NSURL *webURL = [NSURL URLWithString:webLink];
    	NSURLRequest *requestStory = [NSURLRequest requestWithURL:webURL];
    	[pictureWebView loadRequest:requestStory];
    
  9. Myriad_Rocker
    Offline

    Myriad_Rocker iPF Noob

    Joined:
    Jul 29, 2010
    Messages:
    6
    Thanks Received:
    0
    Trophy Points:
    0
    Location:
    United States
    Ratings:
    +0 / 0
    Do you have to synthesize the accessor methods? I think that's the space lingo. :D I saw that when I was doing the Hello World tutorial.
  10. MikesTooLz
    Offline

    MikesTooLz Super Moderator Staff Member

    Joined:
    May 7, 2010
    Messages:
    2,364
    Thanks Received:
    19
    Trophy Points:
    0
    Location:
    Miami, FL
    Ratings:
    +20 / 0
    synthesize pictureWebView

    and in the .H file make sure you add

    IBOutlet UIWebView *pictureWebView;
    @property (nonatomic, retain) UIWebView *pictureWebView;







    You can change pictureWebView to what ever name you want to call it, thats just what I used in my app.
  11. Myriad_Rocker
    Offline

    Myriad_Rocker iPF Noob

    Joined:
    Jul 29, 2010
    Messages:
    6
    Thanks Received:
    0
    Trophy Points:
    0
    Location:
    United States
    Ratings:
    +0 / 0
    Okay, so I can get it to work except for the webview. I'm just trying to pull up Google in it right now.

    I have it doing it when I click a button but it's not working. Here's my code...

    Code:
    #import "ViewController.h"
    
    
    @implementation ViewController
    
    @synthesize textField;
    @synthesize label;
    @synthesize string;
    @synthesize pictureWebView;
    
    - (IBAction)updateList:(id)sender {
        
        // Tell the UIWebView to load the page
        NSString *webLink = @"http://www.google.com";
        NSURL *webURL = [NSURL URLWithString:webLink];
        NSURLRequest *requestStory = [NSURLRequest requestWithURL:webURL];
        [pictureWebView loadRequest:requestStory];
        
        self.string = textField.text;
        NSString *nameString = string;
        
        if ([nameString length] == 0) {
            nameString = @"<";
        }
        NSString *update = [[NSString alloc] initWithFormat:@"Store # %@", nameString];
        label.text = update;
        [update release];
        
    }
    
    - (BOOL)textFieldShouldReturn:(UITextField *)theTextField {
        if (theTextField == textField) {
            [textField resignFirstResponder];
        }
        return YES;
    }
    
    Then on down below that, I have it releasing:

    Code:
    - (void)dealloc {
        [textField release];
        [label release];
        [string release];
        [pictureWebView release];
        [super dealloc];
    }
    
    And here's the h file...

    Code:
    #import <UIKit/UIKit.h>
    
    
    @interface ViewController : UIViewController {
        UITextField *textField;
        UILabel *label;
        NSString *string;
        UIWebView *pictureWebView;
        
    }
    
    @property (nonatomic, retain) IBOutlet UITextField *textField;
    @property (nonatomic, retain) IBOutlet UILabel *label;
    @property (nonatomic, copy) NSString *string;
    @property (nonatomic, retain) UIWebView *pictureWebView;
    
    - (IBAction)updateList: (id)sender;
    
    @end
    
    FINALLY...one question.

    Is there like a "page load" kind of event where I can load up an initial default page in the webview before I try passing it a "Store #"? Hope that made sense.
  12. MikesTooLz
    Offline

    MikesTooLz Super Moderator Staff Member

    Joined:
    May 7, 2010
    Messages:
    2,364
    Thanks Received:
    19
    Trophy Points:
    0
    Location:
    Miami, FL
    Ratings:
    +20 / 0
    Myriad_Rocker check your private message.
  13. MikesTooLz
    Offline

    MikesTooLz Super Moderator Staff Member

    Joined:
    May 7, 2010
    Messages:
    2,364
    Thanks Received:
    19
    Trophy Points:
    0
    Location:
    Miami, FL
    Ratings:
    +20 / 0
    Let me know if you ever got my email.

Share This Page

Search tags for this page
asp.net datagrid on ipad safari
,
data grids on ipad
,
datagrid ios ipad
,
display data grid xcode
,
download lingoes for ipad
,
how to display grid data in ipad
,
how to populate cellular data number
,

ios data grid

,
ios data grid table
,
ios display grid data
,
ios making a datagrid control
,
ipad app on data grid
,
ipad data grid display
,
ipad data grids
,

ipad datagrid

,
make a datagrid in ipad
,
xcode dbgrid ipad