What's new
Apple iPad Forum 🍎

Welcome to the Apple iPad Forum, your one stop source for all things iPad. Register a free account today to become a member! Once signed in, you'll be able to participate on this site by adding your own topics and posts, as well as connect with other members through your own private inbox!

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

Myriad_Rocker

iPF Noob
Joined
Jul 29, 2010
Messages
6
Reaction score
0
Location
United States
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.
 
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.
 
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.
I like this idea. However, would I have to use Safari?
 
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.
 
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.
Nice. I'll see what the boss says about that.
 
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.
Nice. I'll see what the boss says about that.


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.
 
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.
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
 
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.
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

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];
 
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.
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

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];
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.
 
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.
 
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.
 

Most reactions

Latest posts

Back
Top